Hello am developer no administrator i have problem with my website (e-shop).
I use HikaShop componetn on my site and want to show last products on home page.
In Home page i add module and set position, and set in configuration to be visible only on HOME page. But dont work. I configure in administration where is visible where is not visible.
I try in my index manual to add
<div id="wraper">
<jdoc:include type="message" />
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault())
{?>
<jdoc:include type="modules" name="position-10" /><?php
} ?>
<jdoc:include type="component" />
</div><!--END OF WRAPER -->
I have top menu (HOME, AboutUs, Product, Contact) and when i click on About us and other page in top menu that module is not visible work fine. But on site i have sidebar where i show product categories. And there is problem, when i click on catetogy last product module is visible there.
Example:
--> TOP Menu
example.com -> TRUE = Module Last Product is Visible
example.com/index.php/abut-us -> FALSE = Module Last
Product is not Visible
example.com/index.php/product -> FALSE = Module Last
Product is not Visible
example.com/index.php/contact -> FALSE = Module Last
Product is not Visible
--> SIDEBAR
example.com/category/17-fishing-road -> TRUE = Module Last
Product is Visible
in all category is visible but i configure only on homepage
And in all sidebar is visible. Any idea how to fix this and put visible only on
example.com/index.php (HOMEPAGE)
Try this:
if(JRequest::getVar('view') == "frontpage" ) {
//You are in!
}
else {
//You are out!
}
The assignment of modules is done via the Module Manager, not the template index.php
Sp, go to the Module Manager (backend), open the module you want to assign, in the bottom left you can select which menu items you want to assign it to.
If it doesn't work using this method, then there must be something wrong with your site.
Hope this helps
Related
I thought a hit counter would be simple enough as it's a pretty basic piece of code to insert to a html page, however when I add statcounter to my rails app, all the navigation links break. Can anyone advise me as to the best way to insert something like this to my app?
It works but when I click on a nav link, it just displays the hit counter on a blank page unless I reload the page or , if I use the invisible hit counter, it displays an empty page for whatever nav link I click.
application.html.erb
<!--
* Statcounter to monitor visitors, etc to my webapp
* #reference https://statcounter.com
-->
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=11051099;
var sc_invisible=0;
var sc_security="0e87dbf6";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="shopify
analytics" href="http://statcounter.com/shopify/"
target="_blank"><img class="statcounter"
src="//c.statcounter.com/11051099/0/0e87dbf6/0/"
alt="shopify analytics"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
I have a Joomla 2.5 page consisting of a logo graphic and an entry button which I want to use as the home page. I've pretty much sorted out how to remove the menu module from this page but I want to remove the header and footer too but I can't see how. I would guess, perhaps wrongly, that changes need to be made in the template (beez20) index.php but what exactly? There seems to be plenty of advice online about removing either header/footer from all pages but not for a single page. Any help would be much appreciated
If header and footer are parts of design and not modules, you have to make an addition to template index.php to disable these parts.
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() != $menu->getDefault()) :
?>
<p> This will be hidden from frontpage </p>
<?php
endif;
?>
You could check this tutorial to help you how to determine if user is viewing the front page for all joomla versions and the addition that is needed for multilingual sites: How to determine if the user is viewing the front page
I can't find anything about this. I just made a html template and set it as a joomla template. But one important thing I can't find how to do is how to set menu from template to Joomla. Do I have to make all items of menu again in Joomla and just take css from this?
(In template is menu made from pictures, in css is hover, position etc.)
<nav id="main_nav">
<ul>
<li class="Item1"></li>
<li class="Item2"></li>
</ul>
</nav>
You should define a position in your template where module can be outputted. It's done like this:
<jdoc:include type="modules" name="position_name" style="xhtml" />
It's always a good idea to declare the position in templateDetails.xml too.
Once you're done yo can log in to your joomla backend (administrator), go to extensions > modules. Click new select "menu" from module type selection list. Then fill up the form (you can enter title for the module, select your position, pick a menu that should be rendered here etc) and you're all set.
The menu items you add to the menu selected should appear in your website.
Sitecore 6.6 Update 4
We're using CustomItemGenerator 1.0 and I was using this to help build a primary navigation menu for a site. This worked as expected and everything was rendered properly.
My problem is when I attempt to edit the menu via Page Editor; I don't even see the menu.
I use a repeater and repeat over a list of links to include in the nav. Due to the way the HTML was created, each LI element needs to have its own, specific ID ("Nav Id" Field in Sitecore) that ties into the CSS. Code inside of my repeater's ItemDataBound event:
// Cast the item using CustomItemGenerator-generated class
GenericContentPageItem navItem = (GenericContentPageItem)e.Item.DataItem;
liMenuItem.ID = navItem.NavId.Rendered; // I tried "navItem.NavId" by itself as well
So while this renders properly in the browser, it doesn't when I'm in Page Editor:
<li id="<input id='fld_B72EB6696DCF41A49671972D5EA5DEB8_2163B90C08AB4A18970A7F3ECE79DCFC_en_1_f71bd37d18d146c19e222e89fcffe278_3' class='scFieldValue' name='fld_B72EB6696DCF41A49671972D5EA5DEB8_2163B90C08AB4A18970A7F3ECE79DCFC_en_1_f71bd37d18d146c19e222e89fcffe278_3' type='hidden' value=" Home?="">
... instead of it rendering like this:
<li id="Home">...</li>
Now, that having been said, I can change my code to not use the CustomItemGenerator and it works fine in the browser and Page Editor as follows:
GenericContentPageItem navItem = (GenericContentPageItem)e.Item.DataItem;
Item nav = Sitecore.Context.Database.GetItem(navItem.ID);
liMenuItem.ID = nav.Fields["Nav Id"].ToString();
I would like to avoid having to hardcode field names in my code, which is why I am using CustomItemGenerator. Is there something that I'm doing wrong with my code that it doesn't want to work in Page Editor?
Thanks!
If you need the actual value out of the field regardless of if you are in the page editor or not, you want to use the Raw property:
liMenuItem.ID = navItem.NavId.Raw;
Does anyone know how to turn the title (name) of a module in Joomla 2.5 ? On my site http://www.amidsfo.ru/ now all modules no title (name).
If the show title is enabled and still does not show the title, check your template,
you have to call your module something like this:
<jdoc:include type="modules" name="left" style="xhtml" />
The magic section is style="xhtml", so make sure you have it.
From the Joomla Administration page, choose the menu item Extensions/Module Manager
Locate and edit the module for which you want the title to appear
On the page that appears, in the Details pane, directly below the Title is Show Title - make sure that Show is selected