We use cookies to ensure that we give you the best experience on our website. We also use cookies to ensure we show you advertising that is relevant to you.If you continue without changing your browser settings, we will assume that you are happy to receive all cookies on this website.

Use a UDT for content styling

A User Defined Tag (UDT) in CMS Made Simple™ is a small piece of PHP-code (without ) that can be called with just a short {SmartyTag}. Using PHP-code for styling a content page or blog article is probably not the first thing that comes in mind. But because of the easy way to name and call the UDT, and the flexibility of its content it is very useful!! Okay, you *do* need a little bit of understanding how to create a line of PHP with single and double quotes...

Here at my blog I use <h3> blocks for subtitles. But I have different kinds of them, and they have different images attached (Font Awesome). Doing this in HTML isn't an option, to complex...

I created a few UDT's which I can place in the content where I want without any fuss.

Create anchor links to titles

UDT content "insert_anchor"

echo'<a name="'.$name.'" title="Open an anchor link to this point in the page" href="'.$url.'"><i class="fa fa-link"></i></a>&nbsp;';

Note: These are just a few examples that work for me! You should adapt or create your own for your need and wishes. The reason I post them is to give you a headstart on an alternative method to the regular styling.