I have three layout views for render my web page (one for logged users, other for unlogged users and one for admin users).
These layouts have the same footers section. This footer is very complex and I'd like centralizing changes to a single footer view.
How I can add a subview inside the layout view, such that the layout will have the following code for rendering the content returned by actionControler?
<?php echo $this->content; ?>
And the following code, but this is always same template and isn't returned by the actionController:
<?php echo $this->footer; ?>
Do I have to modify onBootstrap method?
If the footer itself is simple you should be able to use the Zend\View\Helper\Partial helper to render a phtml file. To do this (inside your layout):
<?php echo $this->partial('view path'); ?>
If the footer requires some logic, it maybe best to look at creating a view helper.
Related
I need to make a footer in Liferay and use theme for it. What's the simpliest way to do it?
I have created new theme, filled _diffs folder with other folders, but it's empty and I couldn't find relevant docs about this. Should I copy all basic files there? What should I change to create footer?
In Liferay, theme's portal_normal.vm serves as the template to
construct HTML structure of the page. There you define your header,
body and footer includes.
When you will look at the portal_normal.vm of classic theme, you will observe following HTML snippet:
<footer id="footer" role="contentinfo">
<p class="powered-by">
#language ("powered-by")
Liferay
</p>
</footer>
This is the footer of the page. This is what you need to implement. However, it's not necessary to use footer tag at all, as you can simply use div or table based structure with bootstrap or customized CSS classes for your footer, it's upto your requirement.
Remember! Classic theme is just like a sample provided by Liferay, so, it's not good idea to directly customize it.
Everybody needs a whole customized view of the site, and for this the best idea is to create a custom theme (that's what you are doing!), that will give you full control over your look-n-feel.
To kick-start, you can initially copy required folders from classic theme to your customized theme's (_diffs folder) and start changing bit by bit.
I have a bottom menu module in my joomla CMS which works fine in footer 1 position. However, when I try to create another menu module in the footer 2 position. it assigns the same articles to this menu item as my first one?
You go to folder "template/{name of template}" and open file "index.php". Then create new module menu footer:
<?php if ($this->countModules('footer_menu')): ?>
<jdoc:include type="modules" name="footer_menu" style="none" />
<?php endif; ?>
After that, you go to backend and config position.
I starting with orchard. I want to override MenuWidgetPart to render as i want. I've created Parts.MenuWidget-MenuWidget.cshtml into Views folder of current theme. But i do not know, how to i can get list menu from Model. Please look my code below:
<nav>
<ul>
#foreach(var m in listMenu){
<li>#m.Text</li>
}
</ul>
</nav>
How to i can get listMenu from Model ?
Templates for Menu and MenuItem are Menu.cshtml and MenuItem.cshtml. You can start by copying those files from /Core/Shapes/Views/ directory to your theme directory. You can modify them as you wish afterwards.
This will, actually modify all your menus on the site. If you want it to be specifically for your widget (Parts.MenuWidget-MenuWidget.cshtml) you can start by copying the contents from Menu.cshtml to your widget template and continue with modifications from there.
EDIT:
To iterate over items you can use the following syntax:
#foreach (var item in Model.Menu.Items){
#Display(item)
}
How can i display external(from server) html content into block region.
let me tell you what i did so far is i created a new block on my site called sitemap and put some php code
<?php include('../sitemap/sitemap.html'); ?>
and set this block region to footer.
But it show nothing so plz help me so i do it.
Maybe the include file path is wrong. For better results, you can put that file in the themes folder and call it.
<?php include(path_to_theme().'/sitemap.html'); ?>
The Drupal documentation about theming search forms says:
* $search['search_theme_form']: Text input area wrapped in a div.
My html page which i want to make a drupal theme uses a special search form so i don't want the form's elements to be wrapped into a div. How can i get the clean search form elements not wrapped into div?
Well the Drupal documentation pretty much says it all: http://drupal.org/node/45295
If you just want to remove the div container overwrite the template search-theme-form.tpl.php or whatever template is responsible for the input search field. You have the instruction on how to overwrite in the link above.
If you want more customization than you'll have to do step #2 from the Drupal tutorial.
So from this:
// #file /modules/search/search-theme-form.tpl.php
<div id="search" class="container-inline">
<?php print $search_form; ?>
</div>
To this:
// #file /sites/all/themes/your-active-theme/search-theme-form.tpl.php
<?php print $search_form; ?>
Don't forget to clear the Drupal's site cache.