Jump to content
  • Deleted template hook still renders in HTML


    Created a template for mobileHeader hook and another template for afterLogo hook.

    Deleted the mobileHeader template but it still renders in HTML along with the afterLogo template. Now there are 2 elements with the same #ID in the HTML causing issues - afterLogo desktop template does not work as the #element in the mobileHeader template takes precedence and gets used (works only in mobile layout). This is not due to any caching issues because the code in the template is meant for logged-in users.

    Expected behavior: Deleted mobileHeader template should not render.

    x332533.invisionservice.com

    Q: What hook to use that would render on both desktop and mobile headers in between nav-menu and user-menu?


    User Feedback

    Recommended Comments

    Marc

    Posted

    Quote

    This is not due to any caching issues because the code in the template is meant for logged-in users.

    This is not nessesarily true. Have you tried clearing cache from the admin CP?

    WebCMS

    Posted (edited)

    54 minutes ago, Marc said:

    This is not necsessarily true. Have you tried clearing cache from the admin CP?

    It did not work after clearing cache and still rendering duplicate elements with same #IDs. If you resize the browser to mobile layout, you can see the element in the header populated with data (due to precedence) and hence visible. On desktop layout, the element is empty and invisible. You can see the duplicate elements rendered in the page source.

    What hook to use that would render on both desktop and mobile headers in between nav-menu and user-menu?

    Edited by WebCMS
    WebCMS

    Posted

    For Guest users, it is working in both desktop and mobile modes (will display just some text and no data will be populated as expected) but it is using 2 templates one of which was deleted already.

    For logged-in users, it is working in mobile mode but not in desktop mode (because the element is empty - no data populated) and using 2 templates one of which was deleted already.

    Marc

    Posted

    I have logged this as a bug. Please as any questions within a separate topic in the discussions area. Its not something I would know in order to be able to advise unfortunately.

    WebCMS

    Posted

    4 hours ago, Marc said:

    I have logged this as a bug. Please as any questions within a separate topic in the discussions area. Its not something I would know in order to be able to advise unfortunately.

    Thanks.

    Please note the div is rendered with an ID and so cannot be duplicated between desktop and mobile layouts. There should be only a single element marked up with the ID so it will get populated with data from server upon page load. And we should be able render the single element globally (between the nav-menu and user-menu in the header) using a single hook.

    This works fine in v4 by editing the globalTemplate.

    • Management
    Matt

    Posted

    It's not a deleted template hook.

    It's the same template being used in two areas as two areas (globalTemplate and globalTemplateHeaderLogic) uses the same template {template="logo" app="core" group="global" params="x"}

    The param contains 'mobile' if it's the mobile logo, which you can use in your HTML.

    Could contain: Page, Text, White Board

    • Management
    Matt

    Posted

    Changed Status to Not a bug

    WebCMS

    Posted (edited)

    .

    Edited by WebCMS

×
×
  • Create New...