I'm trying to include the conents of a field using the insert value-of method in an xslt file. I click on the icon 'Insert xslt:value-of', scroll to the field I'm looking for, select it and finally click the 'Insert value' button. The code appears in the file, but when I save it and reload the page in the browser it doesn't show up. I tried a variety of fields and I get the same thing. What am I missing here?
I guess a little clarification is on order. Thanks by the way.
The page in question is pulling everything it displays from a macro (actually a bunch of macros). Everything I've done so far works as intended.
The xslt I'm trying to add stuff to is CoursePage.xslt. Again, this works fine so far. The problem is that when I try to pull in the contents of a field by using 'Insert xslt:value-of' nothing is display (I looked at the visualziation and the source code of the page in the browser).
This field does have an image in it (all other fields I tried had something in them as well). I have a page that displays it very nicely. In that case, the field is directly inserted into the template for that page.
Here is the entire xslt. The field is at the very bottom
<!-- Don't change this, but add a 'contentPicker' element to --> <!-- your macro with an alias named 'source' --> <xsl:variable name="source" select="/macro/source"/>
One more thing (and I don't know if this is relevant, but in case it is). The page displayed in the in the browser is /dispcourse.aspx?course=standard. It has a single richt text field to house the macro that puts everything together. It's called 'Course Page.' This macro has many different componets that live in their separate macros. I haven't run into any problems so far, because in these (let's call them) sub macros everything is hard coded. Now I'm in the process of using information from the query string and logic to put the contents of the page together dynamically. For instance, 'course=standard' will need to have a different title from 'course=advanced-standard'. I sure hope this makes sense.
The reason your value-of doesn't output anything has to do with the XML context - I made a Gist once to explain something very similar: https://gist.github.com/871656
Ususally, you just want to take the field from the current page, e.g.: $currentPage/aboutGrandfatherImage
Trouble with 'Insert xslt:value-of'
I'm trying to include the conents of a field using the insert value-of method in an xslt file. I click on the icon 'Insert xslt:value-of', scroll to the field I'm looking for, select it and finally click the 'Insert value' button. The code appears in the file, but when I save it and reload the page in the browser it doesn't show up. I tried a variety of fields and I get the same thing. What am I missing here?
Hi Kory,
Can you tell us more about what you are trying to achieve and if possible your xslt?
//fuji
Assuming you are using xsl:value-of in a Macro, are you calling that macro from your page?
Have you looked in the page source, after it has loaded, to see if its there but just not showing on the front end?
I would recommend that you have a look at using the Visualise XSLT button to select a page on your website and see what the macro is out-putting.
Click "Encode/decode result" to see tyhe pure HTML generated by your macro.
If you are still having trouble, it may help if you post your XSLT here.
Cheers,
Drew
I guess a little clarification is on order. Thanks by the way.
The page in question is pulling everything it displays from a macro (actually a bunch of macros). Everything I've done so far works as intended.
The xslt I'm trying to add stuff to is CoursePage.xslt. Again, this works fine so far. The problem is that when I try to pull in the contents of a field by using 'Insert xslt:value-of' nothing is display (I looked at the visualziation and the source code of the page in the browser).
The field I'm trying to get is
This field does have an image in it (all other fields I tried had something in them as well). I have a page that displays it very nicely. In that case, the field is directly inserted into the template for that page.
Here is the entire xslt. The field is at the very bottom
One more thing (and I don't know if this is relevant, but in case it is). The page displayed in the in the browser is /dispcourse.aspx?course=standard. It has a single richt text field to house the macro that puts everything together. It's called 'Course Page.' This macro has many different componets that live in their separate macros. I haven't run into any problems so far, because in these (let's call them) sub macros everything is hard coded. Now I'm in the process of using information from the query string and logic to put the contents of the page together dynamically. For instance, 'course=standard' will need to have a different title from 'course=advanced-standard'. I sure hope this makes sense.
Hi Kory,
The reason your value-of doesn't output anything has to do with the XML context - I made a Gist once to explain something very similar: https://gist.github.com/871656
Ususally, you just want to take the field from the current page, e.g.: $currentPage/aboutGrandfatherImage
/Chriztian
is working on a reply...