Navigator template for footer not working

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Locked
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Navigator template for footer not working

Post by jakovbak »

Hello everyone!
I have a problem considering second menu in footer and I can't figure out what's wrong. If someone can point me to the right direction it would be great!
I am using this as main navigation:

{Navigator template="00_acs_navigator" show_all="0"}

and it's working fine.
There is second navigation in footer:

{Navigator template="00_acs_footer_navigator" show_all="0"}

and it's not working at all. There is no navigation in the footer, all I get in footer is exactly the same expression I have used for navigation call in footer (the red one from above).
"00_acs_footer_navigator" template was placed in the page called "00_acs_footer" which was called into templates with {page_attr page="00_acs_footer" key="footer"}. Entire footer block is ok, it's showing up with all it's elements except navigation.
What am I doing wrong?

Thank you in advance for your help and best regards!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Navigator template for footer not working

Post by velden »

Would this work?

{page_attr page="00_acs_footer" key="footer" assign='footer'}
{eval var='footer'}
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Navigator template for footer not working

Post by jakovbak »

If I put it instead

{Navigator template="00_acs_footer_navigator" show_all="0"}

same thing happens. Not working, just showing the new expression in the footer - the content of curly brackets with the brackets themselves.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Navigator template for footer not working

Post by Jo Morg »

jakovbak wrote:If I put it instead

{Navigator template="00_acs_footer_navigator" show_all="0"}

same thing happens. Not working, just showing the new expression in the footer - the content of curly brackets with the brackets themselves.
Did you give velden's suggestion a try?
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Navigator template for footer not working

Post by jakovbak »

Yes and sorry, my previous answer was not very precise... I have tried with Velden's suggestion but ended up with same result.

If I put this

{page_attr page="00_acs_footer" key="footer" assign='footer'}
{eval var='footer'}

instead of this

{Navigator template="00_acs_footer_navigator" show_all="0"}

same thing happens. Not working, just showing the new expression in the footer - the content of curly brackets with the brackets themselves.


That's how it should've been written...
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Navigator template for footer not working

Post by Jo Morg »

That was not what velden suggested at all...
jakovbak wrote:(the red one from above).
"00_acs_footer_navigator" template was placed in the page called "00_acs_footer" which was called into templates with {page_attr page="00_acs_footer" key="footer"}. Entire footer block is ok, it's showing up with all it's elements except navigation.
What am I doing wrong?
What velden suggested (if I understood correctly) was to replace {page_attr page="00_acs_footer" key="footer"} with {page_attr page="00_acs_footer" key="footer" assign='footer'}{eval var='footer'}... unless I'm missing something...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Navigator template for footer not working

Post by jakovbak »

Stupid me... But unfortunately me being silly or not won't change a thing. Same thing happens (see footer screenshot in attachment).
Attachments
footer_nav.jpg
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Navigator template for footer not working

Post by Jo Morg »

Then something else has to be the issue. That would have solved your problem as the {page_attr...} tag doesn't evaluate the contents iirc. You may need to explain better what you are doing.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Navigator template for footer not working

Post by jakovbak »

Ok. I'm still struggling a little bit with this new approach for certain elements of 2.x CMSMS so maybe I got it all wrong, I don't know...
I wanted to make several page templates containing a couple of shared elements. One element is above mentioned "acs_footer". In documentation there is a section explaining new approach to "GC blocks" so I have created a page called "00_acs_footer" to use it as "GC block" across all of the site templates. A template within a template I guess... And it works, "footer" is being displayed on every page like it should be.
The only problem is - footer navigation.
I have Navigator::Navigation called 00_acs_footer_navigator (I don't want sitemap or something like that, I want specific pages to be displayed in this menu). So, this 00_acs_footer_navigator is included in my "GC block" like this:

Code: Select all

<div class="container">
                		<div class="col-md-3 col-sm-6">
                    			<h4><img class="img-responsive" src="uploads/img/acs-logo.png" alt=""></h4>
                		</div> <!-- /.col-md-3 -->
				<div class="col-md-3 col-sm-6">
                    			<h4>Društvene mreže</h4>
					<div class="social">
						<a href="#" class="external facebook" data-animate-hover="pulse"><i class="fa fa-facebook"></i></a>
						<a href="#" class="external gplus" data-animate-hover="pulse"><i class="fa fa-google-plus"></i></a>
						<a href="#" class="external twitter" data-animate-hover="pulse"><i class="fa fa-twitter"></i></a>
					</div>
					<hr class="hidden-md hidden-lg">
				</div> <!-- /.col-md-3 -->
				<div class="col-md-3 col-sm-6">
                    			<h4>Navigacija</h4>
						{Navigator template="00_acs_footer_navigator" show_all="0"}
					<hr class="hidden-md hidden-lg">
				</div> <!-- /.col-md-3 -->
				<div class="col-md-3 col-sm-6">
					<h4>Lokacija</h4>
					<p><strong>Auto centar "Star"</strong>
						<br>Ulica
                        			<br>Zadar
                        			<br>Hrvatska
                        			<br>Telefon
                        			<br>Telefax
                    			</p>
					<a href="#" class="btn btn-small btn-template-main">Idi na "Kontakte"</a>
					<hr class="hidden-md hidden-lg hidden-sm">
				</div> <!-- /.col-md-3 -->
			</div> <!-- /.container -->
			<a href="#" class="back-to-top">
				<i class="fa fa-angle-up"></i>
			 </a><!-- Go To Top Link -->
The way I see it (and I repeat, it could be all wrong!), this call for navigation should work. I can't find any spelling mistakes but I'm not a programmer so I can't find any other reason by myself.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Navigator template for footer not working

Post by velden »

Not quite an answer to the problem, but as I notice you're using a lot of markup (code) and only little content, it doesn't seem the code is to be edited by an editor, does it?

Wouldn't it then be better to use a template of Core::Generic and include that in your other templates? Possibly even better/easier would be to make use of template inheritance.

IMO the {page_attr ...} method should only be used if you want one or more 'GCBs' which are to be edited by an editor (so content only, no markup).
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1974
Joined: Mon Jan 29, 2007 4:47 pm

Re: Navigator template for footer not working

Post by Jo Morg »

To add a bit to what velden just said:
Global Content Blocks were removed because they were, more often than not, being badly used. They were actually templates, but were being used as both templates and content blocks which meant that we were allowing content editors to interfere with the design... which is always a bad thing. Content Blocks shouldn't be evaluated (parsed by the smarty engine) with very few exceptions.
On the other hand we were duplicating something that Smarty already does, and does better: including templates inside templates so that you can have construction blocks that you can easily rearrange on one main template. And Smarty also has template inheritance (as velden referred) which is way better than including templates inside templates (nesting too often and too deep may slow a site to a crawl). Knowing how to use these may take some time to learn but is a good set of tools to have at hand: they will definitely make your sites better and faster to develop when mastered.
And when you do need content blocks (without design elements on them) there are several other approaches, one being the {page_attr ...}, other by using 3rd party modules which already exist and give a few more options.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: Navigator template for footer not working

Post by Jeff »

If the module call isn't getting evaluated by smarty then it is problem that it is place in a non-smarty code.

You need to start at the begin and figure out why it isn't getting evaluated. -- I can't make sense of where the module call is that it isn't getting parsed with smarty.

If you need help you should post each template so we can trace the smarty parsing.
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

Re: Navigator template for footer not working

Post by jakovbak »

Ok guys, thank you for your suggestions! Now I'll try to figure out what's wrong by eliminating errors in step-by-step method. I'll get back to you as soon as I get something useful!
jakovbak
Forum Members
Forum Members
Posts: 234
Joined: Thu Dec 13, 2012 2:54 pm

[SOLVED] Re: Navigator template for footer not working

Post by jakovbak »

WOW! The very first attempt solved the problem!
I have created new Core::Generic template (tnx velden! ;D ) and copy/paste the entire code from 00_acs_footer page (code was quoted above) without any changes. Then I have replaced

{page_attr page="00_acs_footer" key="footer" assign='footer'}

with

{include file='cms_template:00_acs_footer_TPL'}

(call for my new Core::Generic template) and now it works!
Thank you guys, not just for your help but also for clearing up a little bit the logic and use of different types of templates.
I wish you all great rest of the day!
Best regards,
Vinko
Locked

Return to “The Lounge”