I start the adventure with prestashop and I would like to have a problem. I have no idea how to add a classe or ID to the module.
My code is:
<h3>Mini Top Menu</h3>
<ul>
<li>
<a id="link-cms-page-1-3" class="cms-page-link" href=""link1 title="link1">
</a>
</li>
<li>
<a id="link-cms-page-4-3" class="cms-page-link" href="link1" title="link1">
</a>
</li>
<li>
<a id="link-cms-page-5-3" class="cms-page-link" href="link1" title="link1">
</a>
</li>
<li>
<a id="link-product-page-prices-drop-3" class="cms-page-link" href="link1" title="link1">
</a>
</li>
</ul>
I would like to add this <ul> ID and get rid of the <h3> tag
I will add that I use Link Widget.
If I got it right:
You have to search for (menu) module on your theme folder to find .tpl files:
"themes/yourTheme/modules/TargetModule/*.tpl"
if this path not exist then you have to search on "modules/TargetModule/templates/...." to find your file.
Tip: don't forget to clear both PrestaShop and browser cache, after any change on tpls
Related
I had an old template and I updated MODX core and extras from 2.2 to 2.6.5.
After the update the output has become very strange.
here's my code for accordion:
<li [[+wf.classes]]>
[[+wf.classnames:contains=`livello2`:eq=`livello2`:then=`<a class="goto_scheda" title="[[+wf.pagetitle]]">[[%cat.vai_scheda? &topic=`catalogo` &namespace=`plastitalia`]]</a>`:else=``]]
<a [[+wf.classnames:contains=`livello1`:eq=`livello1`:then=`class="link_tassonomia"`:else=``]] href="[[+wf.link]]" title="[[+wf.pagetitle]]">[[+wf.pagetitle]]</a>
[[+wf.wrapper]]
</li>
and this is the output:
<ul class="sottomenu_catalogo">
<li class="first livello2">
first livello2
<a first="" livello2="" href="/catalogo/packaging/category/product-ml-50" title="Product ml 50">Product ml 50</a>
</li>
<li class="livello2">
livello2
<a livello2="" href="/catalogo/packaging/category/product-ml-80" title="Product ml 80">Product ml 80</a>
</li>
</ul>
Is there someone that has some idea about how to fix this?
I was missing the :or operator so, for some strange reason wayfinder was printing the condition as class.
<li [[+wf.classes]]>
[[+wf.classnames:contains=`livello2`:or:eq=`livello2`:then=`<a class="goto_scheda" title="[[+wf.pagetitle]]">[[%cat.vai_scheda? &topic=`catalogo` &namespace=`plastitalia`]]</a>`:else=``]]
<a [[+wf.classnames:contains=`livello1`:or:eq=`livello1`:then=`class="link_tassonomia"`:else=``]] href="[[+wf.link]]" title="[[+wf.pagetitle]]">[[+wf.pagetitle]]</a>
[[+wf.wrapper]]
</li>
How can I create a function to scan all menu items from Drupal 7 system and if there is a nested ul, add dropdown CSS classes to the nested ul and add a custom attribute to the parent li container? Im using UIKIT which will automatically create the dropdowns.
Here's my current menu HTML output:
<ul class="menu">
<li class="first last expanded">
<a title="" href="/node/add">Add content</a>
<ul class="menu">
<li class="first leaf">
<a title="article" href="/node/add/article">Article</a></li>
<li class="leaf">
<a title="page" href="/node/add/page">Basic page</a></li>
<li class="last leaf"><a title="blog" href="/node/add/blog">Blog entry</a></li>
</ul>
</li>
</ul>
Here's what I need it to be:
<ul class="menu">
<li class="first last expanded" data-uk-dropdown>
<a title="" href="/node/add">Add content</a>
<ul class="menu uk-dropdown">
<li class="first leaf">
<a title="article" href="/node/add/article">Article</a></li>
<li class="leaf">
<a title="page" href="/node/add/page">Basic page</a></li>
<li class="last leaf"><a title="blog" href="/node/add/blog">Blog entry</a></li>
</ul>
</li>
</ul>
Im looking for the simplest approach possible.
You can crawl menu tree your self and write out menu HTML as you like. Used that and should be something like:
$tree = menu_tree_all_data('menu_machine_name');
Also, if I remember well, if you do only that your active (current) menu item won't be marked any way, and for marking it you have to also call (after getting $tree variable) :
menu_tree_add_active_path($tree);
But again, if I remember well, that function is only available if you install "Menu block" module...
Print out $tree variable after that and organize your code to crawl recursively menu tree you collected.
It is possible to create an IF query for the tag in SPIP?
When i have only one article linked to the tag than he take me directly to the article. But if i have more than 1 article, than he does taken me to the tag page of spip, where are the listing of the linked article.
Here the code to go directly to the article
<div id="tagsphere-#ENV{id_article}">
<ul>
<BOUCLE_mot(MOTS){id_groupe ?}>
<B_article>
<li>
<a<BOUCLE_article(ARTICLES){id_mot = #ID_MOT}{0, 1}> href="#URL_ARTICLE"</BOUCLE_article>>
#TITRE
</a>
</li>
</B_article>
</BOUCLE_mot>
</ul>
</div>
and here the code to go to the tag menu
<div id="tagsphere-#ENV{id_article}">
<ul>
<BOUCLE_mot(MOTS){id_groupe ?}>
<li>[(#TITRE)]</li>
</BOUCLE_mot>
</ul>
</div>
Thanks in advance
Try this, will work with any SPIP version.
<BOUCLE_mot(MOTS){id_groupe ?}>
[(#REM) Link to mot]
<BOUCLE_check(ARTICLES) {id_mot} {1,1}>
<li>#_mot:TITRE</li>
[(#ID_ARTICLE|oui)]
</BOUCLE_check>
[(#REM) Link to one article]
<BOUCLE_one(ARTICLES) {id_mot} {0,1}>
<li>#_mot:TITRE</li>
</BOUCLE_one>
<//BOUCLE_check>
</BOUCLE_mot>
Conditional display is a real lack in SPIP. This is what I would do (don't have any SPIP environment with me to check).
<div id="tagsphere-#ENV{id_article}">
<ul>
<BOUCLE_mot(MOTS){id_groupe ?}>
<BOUCLE_articles(ARTICLES){id_mot = #ID_MOT}>
<B_article_unique>
<li>
<a<BOUCLE_article_unique(ARTICLES){id_article}{si #TOTAL_BOUCLE|==1}> href="#URL_ARTICLE"</BOUCLE_article_multiple>>
#TITRE
</a>
</li>
</B_article_unique>
<BOUCLE_article_multiple(ARTICLES){id_article}{si #TOTAL_BOUCLE|!=1} />
<li>
<a href="#URL_MOT">
#TITRE
</a>
</li>
</B_article_muliple>
</BOUCLE_articles>
</BOUCLE_mot>
</ul>
</div>
Another, what could be a silly, question. I have a very in-depth navigation menu on my clients site. I don't mind doing the hard slog now changing all the pages and links to .php - will save mucho time in the future. I want to use <?php include_once("nav.php"); ?> to pull this into every page. At the moment the parent item that is active will be highlighted depending on which child page is being viewed. The menu structure is currently just part of each of the .html page.
HTML markup:
<div id="navigation-wrapper">
<nav id="main-navigation">
<ul class="main-menu">
<li><span aria-hidden="true" class="li_display nav_icon"></span>About
<ul>
<li>Corporate Profile</li>
<li>Board of Directors</li>
<li>Operating Divisions</li>
<li>Organisational Chart</li>
<li>Corporate Documentation</li>
</ul>
</li>
<li><span aria-hidden="true" class="li_news nav_icon"></span>Investor
<ul>
<li>Overview</li>
<li>Financial</li>
<li>News</li>
<li>Events</li>
<li>General</li>
<li>Register for Alerts</li>
</ul>
</li>
<li><span aria-hidden="true" class="li_bulb nav_icon"></span>Products
<ul>
<li>Mecer</li>
<li>Hardware
<ul>
<li>APC</li>
<li>Acer</li>
<li>ASUS</li>
<li>E-Beam</li>
<li>Fujitsu</li>
<li>Huawei</li>
<li>Lenovo</li>
<li>Microsoft</li>
<li>NEC</li>
<li>Samsung</li>
<li>Toshiba</li>
</ul>
</li>`enter code here`
<li>Mustek Energy
<ul>
<li>Solar Panels</li>
<li>LED Lighting Solutions</li>
</ul>
</li>
<li>Mustek Solutions
<ul>
<li>Mustek Cloud Computing</li>
<li>Mustek Digital Signage</li>
<li>Mustek POS Solutions</li>
<li>Mustek Security Technology</li>
</ul>
</li>
<li>Networking Solutions
<ul>
<li>D-Link</li>
<li>Huawei</li>
<li>Miniflex</li>
<li>NEC</li>
<li>NComputing</li>
</ul>
</li>
<li>Printing Solutions
<ul>
<li>Brother</li>
<li>Epson</li>
</ul>
</li>
<li>Complete Product Catalogue</li>
</ul>
</li>
<li><span aria-hidden="true" class="li_settings nav_icon"></span>Support
<ul>
<li>DealerNet</li>
<li>Dealer Application Form</li>
<li>Dealer Locator</li>
<li><a href="http://downloadcenter.mustek.co.za/list.php?dir=Repository" target=_blank>Download Latest Drivers</a></li>
<li>Mecer EyeSPY</li>
</ul>
</li>
<li><span aria-hidden="true" class="li_phone nav_icon"></span>Contact
<ul>
<li>Branches</li>
<li>Customer Liaison</li>
<li>Investors</li>
<li>Sales Queries</li>
<li>Technical Queries</li>
<li>Careers</li>
</ul>
</li>
</ul>
</nav>
</div>
As you can see the class="active-page" dictates which parent icon to show. I read somewhere that by adding <?php $page = "page-name"; ?> it will say which page this is and will act like the class="active-page". Do I need to create an id for the page in the nav.php file that it will reference?
Sorry guys, but my knowledge of PHP is very limited, but I am trying to learn the basics on the fly. Any help is greatly appreciated!
Just use an if-statement to add "active-page" as class to the current active page:
<li><span aria-hidden="true" class="li_display nav_icon"></span>About
You then need to define a constant ACTIVE_PAGE before including your navigation.
<?php
define ('ACTIVE_PAGE', "About");
include ('yournav.php');
?>
This should work and is okay if you do not have too many pages.
An alternative could be in getting the currently visited page via
$_SERVER['PHP_SELF']
and then add to navigation.php which html-file shall be called for which entry in php_self. The advantage would be that you have all your navigation-based code in one place. Personally, I would prefer this last solution.
Below is a php issue I am having, it works in other ways but doesn't work the way I wish too.
Basically I wish to add the WP login and logout commands to the the A-HREF links, but the closing short code doesn't seem to be taken effect and I would like to know why and hopefully fix this problem.
<?php
echo do_shortcode('[not-level-visitors]') .
'<div id="SignUp">
<ul>
<li><img src="http://dev.universitycompare.com/wp-content/themes/blue-and-grey/images/icons/user_icon.png" alt="User Icon My Account University Compare" />
My Account
</li>
<li>
Log Out
</li>
</ul>
</div>' .
do_shortcode('[/not-level-visitors]');
?>
Basically the above code is kind of working, but I just need the closing shortcode to work as it appears in my html and is not being recognised - I have created the above code from this below snippet that I am already using that works completely:
<?php
echo do_shortcode('[level-visitors]
<div id="SignUp">
<ul>
<li>
Sign Up
</li>
<li>
Login
</li>
</ul>
</div>
[/level-visitors]');
?>
The main difference I spotted is the single call vs multiple calls to do_shortcode, I assume it's failing to match the regex.
Maybe this will work:
echo do_shortcode('[not-level-visitors]
<div id="SignUp">
<ul>
<li><img src="http://dev.universitycompare.com/wp-content/themes/blue-and-grey/images/icons/user_icon.png" alt="User Icon My Account University Compare" />
My Account
</li>
<li>
Log Out
</li>
</ul>
</div>[/not-level-visitors]');
It looks like you need to remove the extra opening/closing parentheses and extra do_shortcode call.
<?php
echo do_shortcode('[not-level-visitors]' .
'<div id="SignUp">
<ul>
<li><img src="http://dev.universitycompare.com/wp-content/themes/blue-and-grey/images/icons/user_icon.png" alt="User Icon My Account University Compare" />
My Account
</li>
<li>
Log Out
</li>
</ul>
</div>' .
'[/not-level-visitors]');
?>