Use a UDT for content styling
Previous article Next articleA 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.
How to use
The "How to use" title
UDT content "how_to_use"
Working example
The "Working example" title
UDT content "working_example"
Example title with anchor link
Create anchor links to titles
UDT content "insert_anchor"
$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]#$name";
echo '<a name="' . $name . '" title="Open an anchor link to this point in the page" href="' . $url . '"><i class="fa fa-link"></i></a> ';
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.
Comment Form
ReviewManager
ReviewManager
0 Comments
No comments yet...