Announcement

Collapse
No announcement yet.

Page Templates Array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Page Templates Array

    Is there a page template array that will list all the page templates in your store?

    Looking to create a custom template based sitemap feed.

    I would also like to wrap this conditional statement around the foreach loop:

    <mvt:if expr="NOT ISNULL l.settings:sitemap_exclude">
    </mvt:if>

    Would this work to exclude certain page templates if there is indeed a page template array?
    Nick Harkins
    www.loveisarose.com
    *Web Developer
    *Miva
    *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

    #2
    I assume you could download the LSK and then open the sitemap feed module source code and see the API functions it calls. Sorry I don't have time to look all that up and post. Seems like a good way though.
    Colin Puttick
    Miva Web Developer @ Glendale Designs

    Comment


      #3
      Code:
      
      <mvt:do file="g.Module_Feature_TUI_DB" name="l.success" value="PageList_Load_All( l.settings:pages )" />
      But it maybe faster to just render the page template you require:

      Code:
      <mvt:do name="l.result" file="g.Module_Feature_TUI_MGR" value="TemplateManager_Render_Page( 'PAGE_CODE' )" />
      http://www.alphabetsigns.com/

      Comment


        #4
        dreamingdigital Found a list of all the api functions here: https://docs.miva.com/api-functions . Thanks for pointing me in the right direction though. I think I have this all figured out now.
        Nick Harkins
        www.loveisarose.com
        *Web Developer
        *Miva
        *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

        Comment


          #5
          alphabet the first snippet is what I found in the api function list and is what I need as I am trying to load all pages into an array, not just one page.

          Thank you for sharing though!
          Nick Harkins
          www.loveisarose.com
          *Web Developer
          *Miva
          *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

          Comment


            #6
            And I just stumbled upon this https://gist.github.com/steveosoule/...clude-item-xml from SteveoSoule

            Added a little snippet (in red) to create a url:

            Code:
            <mvt:do file="g.Module_Feature_TUI_DB" name="l.success" value="Item_Load_Code( 'sitemap_exclude', l.item )" />
            <mvt:do file="g.Module_Feature_TUI_DB" name="l.success" value="PageList_Load_Offset_Item_Unassigned( l.item:id, 0, '', '', 999, l.next_offset, l.pages )" />
            <mvt:assign name="l.result" value="miva_array_filter_ref( l.pages, 0, l.page, 'l.page:admin EQ 0', l.settings:sitemap_pages )" />
            <mvt:foreach iterator="page" array="sitemap_pages">
                    &mvt:page:code;<br>
                    &mvt:page:name;<br>
                    &mvt:page:id;<br>
                    &mvt:page:title;<br>
                  <mvt:do file="g.Module_Feature_URI_DB" name="l.have_uri" value="URI_Load_Page_Canonical(l.settings:page:id, l.settings:uri_info)" />
                    <mvt:if expr="l.have_uri">
                            <mvt:assign name="l.settings:page:link" value="g.domain:mmc_output $ '://' $ g.domain:name $ l.settings:uri_info:uri" />
                           &mvt:page:link;<br>
                    </mvt:if>
            </mvt:foreach>
            On to setting up the rest of this custom sitemap
            Last edited by SidFeyDesigns; 06-22-21, 12:50 PM.
            Nick Harkins
            www.loveisarose.com
            *Web Developer
            *Miva
            *Google Analytics, Search Console, Tag Manager, Merchant Center, Ads

            Comment

            Working...
            X