Magento, Navigation Active Class and Breadcrumbs Behaving Strange - class

Another Magento issue - there seems no end to them.
This time the top menu navigation class 'active' and breadcrumbs seem to appear/disappear depending on the user journey (I guess due to page caching).
Example...
If I'm on the homepage and click an product from the 'New Products' widget - the breadcrumb becomes: Home > New Product Name (missing out the 'clothes / Tops / Long-sleeved' etc), plus the navigation active class is not appearing.
If I view that very same product first by navigating through the shop categories, then I return to the homepage and click the same product from 'New Products' - the breadcrumb works fully, and the active class is applied in the navigation menu correctly.
Why is this? What is happening and how can I fixed it?
Any advice much appreciated.
EDIT 1: in addition, if I navigate to a product through the categories in the menu, click into a different category (outside of the products root cat), then hit the back button on the browser... the same thing happens, breadcrumb reduced to 'home / product name' and the menu active class disappears.

Not sure if this is an 'issue' or a feature. Magento can have the same product in multiple categories. So Product A can be in the root category, Category 1 > Subcategory 1 and Category 2, all at the same time. What should be the url then? You have the following options:
website.com/ProductA.html
website.com/Category1/ProductA.html
website.com/Category2/ProductA.html
website.com/Category1/Subcategory1/ProductA.html
None of them are 'wrong' and doesn't even stop here, imagine a multistore environment where two stores have the same root category, but different domains and languages:
website.com/ProductA.html
website.com/Category1/ProductA.html
website.com/Category2/ProductA.html
website.com/Category1/Subcategory1/ProductA.html
website.org/ProductA.html
website.org/Category1/ProductA.html
website.org/Category2/ProductA.html
website.org/Category1/Subcategory1/ProductA.html
etc.
Conclusion, if you really want the breadcrumbs and active-class to appear when clicking on a product from the 'New Products'-widget, you have to modify the widget's block so that it prints the product URL in a customized way.

Related

Maui Shell Uri Navigation, Multiplate pages on stack and backwards navigation

I am developing a warehouse management application using Maui.
At the moment, I am using the GoToAsync method to navigate between pages, however, I have encountered a problem.
The structure of my pages:
Main menu with several buttons, select the first one:
Location ->
search location ->(after scanning the code)
3.List of products on the location ->(after selecting the product)
4.List with operations to perform (each one displays a different page) -> select the first one
5.Move the product to another location
etc.
Depending on the button selected in point 4, a different number of pages can be put on the stack, for example, after selecting the operation in point 5, 3 or 4 or 5 more pages can be put on the stack.
This is how I register my pages:
Routing.RegisterRoute(nameof(MenuPage), typeof(MenuPage)); Routing.RegisterRoute(nameof(ProductSearchPage), typeof(ProductSearchPage)); Routing.RegisterRoute(nameof(ProductListPage), typeof(ProductListPage)); Routing.RegisterRoute(nameof(ProductDetailsPage), typeof(ProductDetailsPage));
So as you can see I don't create a hierarchy of Uri addresses e.g. Page1/Page2/Page3 because, pages like the code finder, or the product list can be accessed from different places in the program.
What I'm trying to do is go back to one of the pages set aside on the stack. In the example given above, I would like each operation selected in item 4 to, in effect, backtrack me to the list of products from level 3. I am unable to determine this using GoToAsync("../../../...") because I do not know how many pages have been set aside.
I would also like to mention that a page like a search engine or a list sends a message about the selected code or item has a list, and this is handled on one of the pages on the stack ( that is why I do not know how many pages I have to backtrack)
I tried GoToAsync(Page3) however it takes me to a new instance of that page, and additionally puts another page back on the stack.
Any ideas how I could approach such an issue?
Is Shell Uri navigation the right mechanism for this type of project?

Add sort by category in product listing Magento

I've tried to find a possible solution for this but without any result I need to display a sort by category field in the default Magento toolbar in product listing page. Does anyone know how to add this feature without messing up my core files?
What you looking for is something Magento calls Layered Navigation.
First you must make a parant category Apparel and one (ore more) child categories, for example:
- shirts
- shoes
- hoodies
Then for all the child categories go to the admin back-end and navigate to:
Catalog -> Manage Categories -> Display settings.
Now make sure you set the field "Is Anchor" to yes.
Apply this setting for all the children categories.
After these steps your front-end product-listing should look like:
http://demo.magentocommerce.com/catalog/category/view/s/apparel/id/18/
At the left sidebar you can see the categories that are children of the parent category Apparel. Of course you can use your own names for the diffrent categories.
Cheers.

TYPO3 footer menu

I wonder what is the best way to do this.
I have two menues on the template for the first two levels of the navigation. They are separate, because they are on slightly different locations on the page.
Now, I used to put all my special meta-nav and footer pages into a sysfolder. That actually works pretty fine with special.directory. So far all good.
But when I open a link from the footer, the footer menu's links are shown in the 2nd-level HMENU. It makes more or less sense as the pages are in a sub-folder and therefore 2nd-level. , but they are in a folder.. So I guessed it should work.
My solution is to hide all pages in the sys-folder and in the footer menu using includeNotInMenu. That works, but I wonder if there is a cleaner solution to avoid sys-folder's content to be treated as 2nd-level pages. I don't like the editor to have to remember to hide the pages to get the expected result.
Thank you
i guess you are asking for "hide in menus". Edit your page sitemap, go to tab "access" select "hide" below "In Menus". Sitemap will not be shown in your menu, as long as you do not set "includeNotInMenu" in your menu rendering.
# assume 12 is the uid of your folder
[PIDinRootline = 12]
# Delete the menu
lib.yourmenu >
# or overwrite it:
lib.yourmenu = TEXT
lib.yourmenu.value = there is nothing to see here
[end]
Using conditions is more difficult to debug. You need to select them in TypoScript Object-Browser, if you want to see the effect of an condition.
You can sent an entryLevel
Defines at which level in the rootLine, the menu should start. Default
is "0" which gives us a menu of the very first pages on the site.
If the value is < 0, entryLevel is chosen from "behind" in the
rootLine. Thus "-1" is a menu with items from the outermost level,
"-2" is the level before the outermost...
See http://wiki.typo3.org/TSref/HMENU
I'm not sure I understand.. Assume I have the following structure
home
home/subpage1
home/subpage2
meta-nav
meta-nav/sitemap
meta-nav/impressum
-> meta-nav is a folder.
Now I have a HMENU for the 2nd level and it shows (depending on the selected page):
(subpage1 and subpage2) or (sitemap and impressum)
Now what I want to achieve is to open the sitemap or the impressum and not see those in the HMENU.
Sorry if that all sounds strange ;-)

Changing Title of home page in Joomla

I am totally new to Joomla. I am trying to help a friend whose ISP has stopped support (for some internal reasons). We need to change the title of the home page.
1) The first place i made a change was in the 'Front Page Manager'. I changed the 'Title' column. The 'Show Title' parameter on this page is set to 'Global'. Yet the new title does not appear.
2) I then downloaded the entire site , consisting of 10,000 files and searched for the old title in all the files. I found the old title in one file which seemed to be used for SEO pruposes , since it had a whole lot of companies and their titles. I uploaded this file. No effect.
3) I then browsed through the database (MySQL) and changed old titles found in MetaKey and MetaDescription columns to new title. I think i checked all tables (almost 100 odd tables). No effect.
4) I found the old title in the 'Top Menu' item and changed it too.
I know this is a bit ambiguous but how could i troubleshoot the source of this title which does not get changed ?
Thanks,
Chak
Titles in Joomla come from several places. As Legycsapo said, the first place you should look is the default menu item. In the Parameters (System) the Page Title should override any other setting unless you have an extension that sets the page title. The Show Page Title option determines if the title shows up in the content, it does not affect the page title.
Try to change it in the menu options. In the mainmenu, click on the "Home" link, or whatever you write for Frontpage, and there are options in the right. The last one is the parameters, system, there is a "Website title" input box. Try there !
You need to change the home page title in the Control Panel Configuration.
In the Site tab you have the Site Name which is what will be written in the page title.
Another solution is, if you have SEF urls enabled, joomla has a native plugin called SEOsimple. Look under Plugin Manager, click on it and change the title to either disable so that it takes the title by default from global configuration or your custom one.

Menu State - ASP.Net MVC

In my ASP.Net MVC View, I have a menu. The menu consists of a number of Parent Items, with Child Items (anchor tags) underneath.
I'm using JQuery to toggle the menu items opened and closed, as the user clicks on them.
Unfortunately, once the user clicks onto an anchor tag, and gets sent to another page, the menu state is lost, and the menus go back to being closed.
Now if this was "normal" ASP.Net I'd be sticking the menu state information into the ViewState, and storing the information that way.
Is it possible to do something similar in MVC?? This is the first MVC project that I've worked on, so go gentle with me!
So let me first make sure I understand you correctly.
The user will click on a menuitem, which will take him to another page. And when he gets to that page you want the menu to reflect the fact that he is on that page? Correct?
This doesn't sound too tricky. I assume the menu is a partial view - so you would render it something like this:
<div id="menu">
<% Html.RenderPartial("Menu"); %>
</div>
So the view will already know which menu item triggered it. For example, if the user clicks on Widgets->New, you might return the NewWidget.aspx view, and it will know that the Menu item to highlight is Widgets->New. So you simply use the overload for RenderPartial to specify the name or id of the menu item to highlight.
<div id="menu">
<% Html.RenderPartial("Menu", "newWidgetLink"); %>
</div>
If it is NOT the case that a view already knows which Menu Item to highlight, you will need to pass the id of the menu item with the link. So your link generation will look something like this:
Html.ActionLink("Menu Item Text",
"Controller name goes here",
"Action name goes here",
new { menuItem = "menuItemId goes here" },
null
)
Then your action will need to handle this parameter. Easiest would be to take the parameter and add it to the ViewData. The Menu will then check in the ViewData for the Id of the MenuItem to highlight.
Maybe this: ASP.NET MVC - Is there a way to simulate a ViewState?
http://blog.maartenballiauw.be/post/2009/10/08/Leveraging-ASPNET-MVC-2-futures-ViewState.aspx
http://forums.asp.net/t/1285163.aspx
and this might help too
http://webcache.googleusercontent.com/search?q=cache:y26JBxHjbBUJ:www.beansoftware.com/ASP.NET-Tutorials/Intro-ASP.NET-MVC.aspx+how+does+mvc+save+view+state&cd=8&hl=en&ct=clnk&gl=us
There are a lot of articles about view states in MVC and since you're new to this perhaps some pre-reading would be handy and may even answer your upcoming questions!
Good luck!