Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
SSI Preview in SitePublisher .Page
System
Is there a way to Preview my Server Side Includes within a SitePublisher .Page.
1. I have a component that has a SSI.
2. When I hit preview on a .Template or .Page, the SSI doesnt show up.
3. If I convert the .Page to a .Html the SSI works fine
Find more posts tagged with
Comments
pann0204
We have achieved the same thing using two skins one for preview and another for SSIs.
Please try this and let me know if you face any issue and its better if you cud attach your SSI code.
Regards,
-P
vpatel
You can include an external HTML file via Java External. If you are on TS 6.7.2 SP1, you can also consider HTML only component (no XML / XSL transformation) -- not sure if that'll help or not.
Migrateduser
Thanks guys...
I was able to use Pann0204's solution...
Migrateduser
Pann0204 or any expert
Is there a way to swtich between Skins automaticly?
When the business user is previewing it shows one skin, but when the html is generated it uses another skin.
vpatel
There isn't an automated way to do switch skins automatically. However you could combine it all into one skin and separate it at the highest level with <xsl:choose>, <xsl:when>, and <xsl: otherwise> (equivalent of if-then-else from a programming language perspective) logic. Basically if you are in preview mode, output X set of HTML tags otherwise output Y set of HTML tags or something.
Migrateduser
How do you determine if you are in preview mode in? I dont see a "mode" element.
Migrateduser
How do you determine if you are in preview mode using xslt? Is there a "mode" element?
I know how to use JavaScript to determine the page type (.html vs .seed). But I couldn’t figure out how to convert my JavaScript variable into an xslt variable.
vpatel
Do you have an External in your component? In the External, you can access methods like RequestContext.isPreview or RequestContext.isRuntime -- look at the API for details. You could expose this value into your content XML payload to the component and then use that value in your XSL.
If you are not using External then there is an "admin" attribute that could be used as a
hack
.
CAUTION
: this is an internal thing -- undocumented feature -- subject to change without notice.
Migrateduser
I used $CONTEXT{*} to Lists all the bean readable members in the context. One of the beans is "genHTML" which is what i needed.
My problem is that the genHTML doesnt get evaluated in time.
pseudocode xslt code---- if "CONTEXT{genhtml} = ''false'"{do something}
when the if statements above gets executed, the genhtml has not been evaluated yet, so it doesnt equal true or false. please help
vpatel
$CONTEXT{*} stuff gets resolved during the XSL transformation time so you cannot do xsl:if on something that gets resolved during that XSL transformation. You can plug it in with an External and do it there and pass the value as part of the payload XML.
Alternatively you can use (at your own risk) the solution I mentioned in your previous email.
Migrateduser
I will try the external.
As a backup, how do I get the "admin" (at my own risk) attribute?
vpatel
Just dump the XML that you recieve from the component and search for "admin" attribute. I believe it is on the root of node of the XML.
Sam_alpha
I created a component to include ssi but its not coming in preview. Its working good when html page is generated.
Can you please elaborate on two skin theory which you mentioned. How to create second skin which will come in the preview of .page.
Code is attached.