Is it possible to add a CSS class to a Smarty tag???

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
Sendlingur
Forum Members
Forum Members
Posts: 62
Joined: Wed Aug 08, 2018 4:59 pm

Is it possible to add a CSS class to a Smarty tag???

Post by Sendlingur »

Hi all, I just starting to use CMSms few days ago. I have a previous experience in html/css/javascript.

I need to know if it is possible to add a simple css class to a smarty tag so the <a> tag has a CSS class when the browser renders it.

this is the Smarty tag that need the class

Code: Select all

{$entry->morelink}
I have tried everything I have thought of but nothing seems to work.

the output must be something like

Code: Select all

<a href="someurl" class="link">see more</a>


here is the style in .link which I need to add to the "see more" link somehow. Otherwise the link styling is not working.

Code: Select all

  .main-banner figcaption .box .link {
        font-size: 20px;
        font-weight: 500;
        color: inherit;
        display: inline-block;
        vertical-align: top; }
        .main-banner figcaption .box .link:hover {
          text-decoration: underline; }
        @media (max-width: 767px) {
          .main-banner figcaption .box .link {
            font-size: 18px; } }
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Is it possible to add a CSS class to a Smarty tag???

Post by Rolf »

Hi,

Beside {$entry->morelink}, there is {$entry->moreurl}.

Code: Select all

<a href="{$entry->moreurl}" class="link">see more</a>
Hope this helps.

Grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Locked

Return to “Layout and Design (CSS & HTML)”