What is the Smarty code to strip out <h3></h3>
-
replytomk3
What is the Smarty code to strip out <h3></h3>
I am trying to strip out from the code that is generated from
{menu start_level="1" number_of_levels="1"}
can someone give me the Smarty code for this?
{menu start_level="1" number_of_levels="1"}
can someone give me the Smarty code for this?
-
replytomk3
Re: What is the Smarty code to strip out <h3></h3>
Yes, I did see that manual. And while thanks for the exact name of the command, how do I do this without creating a smarty variable articleTitle?
Why didn't something like this work:
{menu start_level="1" number_of_levels="1" | regex}
Why didn't something like this work:
{menu start_level="1" number_of_levels="1" | regex}
-
JeremyBASS
Re: What is the Smarty code to strip out <h3></h3>
if you want to do this... you could go
{capture assign=levelOneMenu}{menu start_level="1" number_of_levels="1"}{/capture}
{$levelOneMenu|replace:"":""|replace:"":""}
that should do what your asking.. If I understand what your wanting...
Cheers
Jeremy
{capture assign=levelOneMenu}{menu start_level="1" number_of_levels="1"}{/capture}
{$levelOneMenu|replace:"":""|replace:"":""}
that should do what your asking.. If I understand what your wanting...
Cheers
Jeremy
-
replytomk3
Re: What is the Smarty code to strip out <h3></h3>
naive question: can I do this without any assignments to variables?
Note to self: stay away from Smarty.
Note to self: stay away from Smarty.
-
JeremyBASS
Re: What is the Smarty code to strip out <h3></h3>
Here are some thing that helped me get Smarty...replytomk3 wrote: naive question: can I do this without any assignments to variables?
Note to self: stay away from Smarty.
one: most all php functions can be used like this
{$foo|replace:"":""} or
{assign var='enddate' value='+30 days'|strtotime}
two: you can use most php function in the if statment...
{if (substr_compare($node->hierarchy, "9.", 0,1)==0)}
I'm the 9th in the menu
{/if}
and the most important thing I've learn... just think php
{assign var=TheValue value=25}
{if ($TheValue & 2)}
I'm just odd
{else}
I'd not be odd but well I'd can't show I'm even
{/if}
Cheers
Jeremy
Re: What is the Smarty code to strip out <h3></h3>
Referring to the original post - you were trying to remove the h3 tags from the menu-generated code. You can do this in two other ways:
1. Edit the menu template and remove the tags (this is probably the the most efficient).
2. Use CSS and remove the defaul styling for h3 so it does not display any different from the other text.
Having the menu generate the H3, then trying to strip it out seems like a waste.
FWIW.
S
1. Edit the menu template and remove the tags (this is probably the the most efficient).
2. Use CSS and remove the defaul styling for h3 so it does not display any different from the other text.
Having the menu generate the H3, then trying to strip it out seems like a waste.
FWIW.
S
-
replytomk3
Re: What is the Smarty code to strip out <h3></h3>
I could not find how the template for the plain-text menu was generating h3 tag. I think that was inherited from the main stylesheet.spcherub wrote: Referring to the original post - you were trying to remove the h3 tags from the menu-generated code. You can do this in two other ways:
1. Edit the menu template and remove the tags (this is probably the the most efficient).
2. Use CSS and remove the defaul styling for h3 so it does not display any different from the other text.
Having the menu generate the H3, then trying to strip it out seems like a waste.
Using CSS to remove styling is something that a little help will be appreciated with.
Re: What is the Smarty code to strip out <h3></h3>
Option #1 - fixing the menu template (better IMHO)
If you are using a relatively new version of CMSMS, then the menu manager is definitely using a template to generate the required HTML for the menu section of your page. Normally the name of the template being used is either in the actual menu code in your page template - something that look like {menu template="name_of_template"}. Or if you are using the CMS out-of-the-box, the default template is the one that is probably active - you can find this under Layout > Menu Manager. (Note if you are running out-of-the-box, you will need to first copy the file template into a database template and then edit it from there.) Read the Menu Manager help for additional usage suggestions.
Option #2 - Fix CSS to nullify effect of H3. This does not actually remove the H3 in your code, but effectively removes from doing anything wacky. There are two options.
Option #2-1 - You can want to hide the H3 and anything inside the H3 tags
h3 {display:none;}
Option #2-2 - You want the content that is within the H3 tags but just ignore the styling
h3 {display:inline;font-weight:normal;padding:0;margin:0;font-size:1em;}
(you may need to do more to make the content look "normal" - the the above is a start)
Of course you should make sure that you provide additional selectors (containing div class name or if for instance) to the CSS code above otherwise ann the H3s in your HTML will be affected.
Hope this helps.
S
S
If you are using a relatively new version of CMSMS, then the menu manager is definitely using a template to generate the required HTML for the menu section of your page. Normally the name of the template being used is either in the actual menu code in your page template - something that look like {menu template="name_of_template"}. Or if you are using the CMS out-of-the-box, the default template is the one that is probably active - you can find this under Layout > Menu Manager. (Note if you are running out-of-the-box, you will need to first copy the file template into a database template and then edit it from there.) Read the Menu Manager help for additional usage suggestions.
Option #2 - Fix CSS to nullify effect of H3. This does not actually remove the H3 in your code, but effectively removes from doing anything wacky. There are two options.
Option #2-1 - You can want to hide the H3 and anything inside the H3 tags
h3 {display:none;}
Option #2-2 - You want the content that is within the H3 tags but just ignore the styling
h3 {display:inline;font-weight:normal;padding:0;margin:0;font-size:1em;}
(you may need to do more to make the content look "normal" - the the above is a start)
Of course you should make sure that you provide additional selectors (containing div class name or if for instance) to the CSS code above otherwise ann the H3s in your HTML will be affected.
Hope this helps.
S
S
-
replytomk3
Re: What is the Smarty code to strip out <h3></h3>
Thank you. What I am trying to do is a bottom text-only menu as described in http://forum.cmsmadesimple.org/index.php/topic,38048.new.html
Re: What is the Smarty code to strip out <h3></h3>
I've posted the fix in the other thread. You had a syntax error in your CSS for the footer nav.
S
S

