Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
ak Posted September 20, 2015 Posted September 20, 2015 When editing page content for an Article Database, other than the standard {database="1"} in Articles content, is there a way to more finely control what is displayed on a more granular level ? I couldn't find any documentation on this on the IPS4 Docs.
opentype Posted September 20, 2015 Posted September 20, 2015 Can you elaborate on what you trying to achieve? I don’t understand your question.
ak Posted September 20, 2015 Author Posted September 20, 2015 What I am trying to do is customise the output of databases lists and records on pages. I found a partial solution to my problem which was to create custom page templates for each of my databases. However now I am stuck with {$fieldValue|raw} which gives me a <span using specific classes. I'm currently trying to work out what other options for $fieldvalue I can use in order to customise the style just for those fields. If there is some documentation on the templating language that I have missed I'd appreciate being pointed to it.
opentype Posted September 20, 2015 Posted September 20, 2015 The field options are described in the field settings in the ACP: You can also customize the field output there without even touching the database view templates. For more control, setting up category/listing/record templates for the database and then customizing them is the right way to go.
ak Posted September 20, 2015 Author Posted September 20, 2015 12 minutes ago, opentype said: You can also customize the field output there without even touching the database view templates. For more control, setting up category/listing/record templates for the database and then customizing them is the right way to go. Thanks. What I have done so far is to create custom HTML templates for each database view and am customising those, because I need to change styles specifically to each view. I'll keep muddling through it and see how I go, thanks for the tips. One question, is it possible to use PHP within HTML templates ?
ak Posted September 20, 2015 Author Posted September 20, 2015 Thanks very much, This will help immensely!
ak Posted September 25, 2015 Author Posted September 25, 2015 I am still trying to work all this out. Is it possible for me to pass the contents of {$record->customFieldDisplayByKey('address', 'listing')} to PHP and perform an action on that returned data ?
opentype Posted September 25, 2015 Posted September 25, 2015 You don’t need to “pass it on”. Just use the double brackets as described in the linked articles for PHP treatment. {{$newvariable = $record->customFieldDisplayByKey('address', 'listing');}}
Recommended Posts
Archived
This topic is now archived and is closed to further replies.