Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted September 20, 20159 yr 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.
September 20, 20159 yr Can you elaborate on what you trying to achieve? I don’t understand your question.
September 20, 20159 yr Author 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.
September 20, 20159 yr 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.
September 20, 20159 yr Author 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 ?
September 25, 20159 yr Author 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 ?
September 25, 20159 yr 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');}}
Archived
This topic is now archived and is closed to further replies.