Routing to image detail adds extra level for image category

  • HI folks,


    I am working on a new site and am trying to get a few things done properly compared to my older site which also uses joomgallery. I am also trying to resolve one issue with the URLs I have noticed on the old site and is persistent also in the new version of Joomgallery


    Lets imagine the following structure of the menu:


    Home -> Gallery -> Civil Aircraft


    Civil Aircraft is a category view. The category page is configured to show only images from one category which is called Civil Aircraft


    Now, when I am on the Category view for Civil Aircraft, the url will be e.g mywebpage/gallery/civil-aircraft

    Once I click on any of the image thumbnails, I am proceeding to the Detail view, and my url will change to something like mywebpage/gallery/civil-aircraft/civil-aircraft/imagealias


    Why would this be adding the category alias twice? This makes no sense and also has a negative impact when indexed by Google. I obviously checked and if I manually remove one category alias from the url, the detail view still displays properly, although all the other links in the gallery navigation (e.g. back to category view) have exactly this same error.


    The desired links from the category view to the detail view of the images should thus be mywebpage/gallery/civil-aircraft/imagealias


    I can try fix this issue myself but before I start working on some workarounds, I would love to hear from the admins here if there is a solution for this and if this can be fixed globally

    • Offizieller Beitrag

    Hi,


    the problem are the additional menu entries for the individual categories (category view). If you move within the gallery, the menu alias remains in the URL.

    Unfortunately, I don't know of a simple solution to the problem.

    What you could do: Change the menu entries for the individual categories from 'JoomGallery >> Category view' to the menu item type 'System Links >> URL'. There you can enter the URL for the respective category as a link. Then the additional alias no longer appears in the URL, only the one from the JoomGallery Category.


    Regards

    MrMusic

  • I see that once I remove the menu item to the category, things return to normal. However, this is by far not a practical solution and this is like you saying that there should basically not be a category view menu option, because it screws things up.


    I have for now fixed it by performing a simple check on the link which is provided to the individual images and fixing it accordingly. It fixes it in the view, although there still are issues which persist and I might have to look into them at a later stage


    Code
    $badcat = $row->alias .'/'.$row->alias;
    $fixedlink = str_replace($badcat, $row->alias, $row->link);