Jump to content

Pages: how to add style in content field?


ipbfuck

Recommended Posts

Posted

Like from object,

I've some database in ipb pages, and i want add custom style in content fiels, but i've this advise:

  • This field is set to be the record content. The content field is not included in the list of custom fields when displayed in the default templates. You can adjust the display options here for when using {$record->customFieldDisplayByKey('content_key', ['display|listing'])|raw}. Using $record->_content will always get the article formatted content.

... if i've fine understood, i've put this in content "custom format", but wihout result:

<p style"somestylehere...">{$record->customFieldDisplayByKey('contenuto', ['listing'])|raw}</p>

someone can help me? :)

 

thanks in advance,

L'AltroWeb (DarkWolf)

Posted
You are missing a “=” in your example. 
 
Note also, if you use the custom field, you don’t make the full call with $record… That’s for Pages templates. 
In the Display Custom Format field you just put something like <p style="color:#F00">{$value}</p>
Posted

Thanks for reply, Ralf...

Yes, in my code is missing a "=", thanks (but i've put this code just for example and i've missed, sorry)...

-

i've try now your code, and also with "raw": <p style="color:red">{$value|raw}</p>

but still do nothing. otuput remain the same here: http://www.laltroweb.it/citazioni/ (and also in directory).

-

works fine, instead, with other field (not with title, and with content. ok with authot field: my custom field in this database).

PS: i've try also with default template... just to be sure.

Posted

But... if i make in css i make for all database. Instead we have here "Custom Format" also in content and title field pages

Quote from you previous post: "put something like <p style="color:#F00">{$value}</p>" ...is so simple instead to go in css and edit here, i think.

Posted

But... if i make in css i make for all database. Instead we have here "Custom Format" also in content and title field pages

Quote from you previous post: "put something like <p style="color:#F00">{$value}</p>" ...is so simple instead to go in css and edit here, i think.

Depends. 

The headline for example is already generated as …

<h2 class="ipsType_pageTitle"><a href="link">Your Headline</a></h2>

It’s really messy to try to force addition styling in there. 
 

Posted

ok, u're right, instead content is outpout in this way:

Screenshot_2015-07-14_22.13.20.thumb.png

no id or class - eg with field name - to put css only to this field... and this, imho, can be simply edit with custom format (with span, or p, or div...)!

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...