Latest Register Log In

+ Advanced Search

Hybrid Field References

Hybrid Field References
By
01/04/16

The article details page may be the most important page on your site, so you probably spend a lot of time customizing it.

The grid-based display of field info on the article details page in the last few series of WSN makes things simple for you. You can manage everything via the field manager, set the order automatically, and not have to mess with the template at all. But sometimes you want more control to make a unique and beautiful layout. So far, the way to do that has been to do things the old pre-field-manager way by putting the template variables directly in the details template. But then your field manager becomes nearly useless and you have to re-write/copy the field display HTML each time you use it. There must be a better way.

In WSN 9.2.39 I'm adding a new, hybrid approach. Instead of rebuilding all your display HTML for each field to take it out of the table, you can now call the field label and the field output HTML separately anywhere in a template. Just use {LINKFIELDLABEL[fieldname]} and {LINKFIELDOUTPUT[fieldname]}. For example, for the tags field:

<div><b>{LINKFIELDLABEL[tags]}</b></div>
<div>{LINKFIELDOUTPUT[tags]}</div>

This way the field manager remains a useful way to manage the output HTML and the label text, although of course the display orders set in the field manager can't affect your free-floating field references.

These LINKFIELDLABEL/LINKFIELDOUTPUT template variables will return content on the details page even when you have the field manager set to not display the field on the details page, so you can uncheck that display box to take it out of the tabular section if you want to have some of the page remain in the tablular format while moving certain fields out of it.





Description Calling the field manager's output HTML for a field from anywhere in a template.
Rating
Views 210 views. Averaging 0 views per day.