Announcement

Collapse
No announcement yet.

Can URI_Load_Item_Canonical get canonical url for a screen like NTFD or one I create?

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

    Can URI_Load_Item_Canonical get canonical url for a screen like NTFD or one I create?

    I'm trying to get the canonical url for a page that I created. For example and testing purposes let's say I want the canonical url of the NTFD page/sceen.

    I found URI_Load_Screen_Canonical in the LSK but it isn't documented on the developer api docs. so I'm guessing I probably shouldn't use it. And I haven't figure out how to anyway.

    I have found example of getting product urls in the forum using this:
    URI_Load_Item_Canonical
    And the documentation seems to imply you can get any uri with it.

    So I tried

    <mvt:assign name="l.uri:store_id" value="g.Store:id" />
    <mvt:assign name="l.uri:screen" value="'NTFD'" />
    <mvt:assign name="l.uri:page_id" VALUE = "0" />
    <mvt:assign name="l.uri:cat_id" VALUE = "0" />
    <mvt:assign name="l.uri:product_id" VALUE = "0" />
    <mvt:assign name="l.uri:feed_id" VALUE = "0" />

    <mvt:do file="g.Module_Feature_URI_DB" name="l.have_uri" value="URI_Load_Item_Canonical(l.uri, l.settings:canonical_uri )" />

    <mvt:if expr="l.have_uri">
    &mvt:canonical_uri:canonical; <br>
    &mvt:canonical_uri:cat_i;<br>
    &mvt:canonical_uri:page_id;<br>
    &mvt:canonical_uri:status;<br>
    &mvt:canonical_uri:store_id;<br>
    &mvt:canonical_uri:uri;<br>
    &mvt:canonical_uri;<BR>
    </mvt:if>

    But I get absolutely nothing.

    how do I get the canonical url for a screen that I create? (I verified that the uri does exist in the uri manager)

    Am I wrong in assuming l.uri:screen should be the screen code?

    #2
    I could be mistaken, but I suspect you probably want to get the canonical URI of a Page, not a screen (Assuming its a page you created from the "User Interface -> Pages" portion of the admin.)

    Something like the following should work (assuming the variable l.settings:my_page_code contains the code of the page you created):

    <mvt:do file="g.Module_Feature_TUI_DB" name="l.settings:load_page" value="Page_Load_Code(l.settings:my_page_code, l.settings:loaded_page)" />
    <mvt:assign name="l.settings:uri:store_id" value="g.Store:id" />
    <mvt:assign name="l.settings:uri:screen" value="''" />
    <mvt:assign name="l.settings:uri:page_id" value="l.settings:loaded_page:id" />
    <mvt:assign name="l.settings:uri:cat_id" value="0" />
    <mvt:assign name="l.settings:uri:product_id" value="0" />
    <mvt:do file=" g.Module_Feature_URI_DB" name="l.settings:have_uri" value="URI_Load_Item_Canonical(l.settings:uri, l.loaded_canonical_uri)" />
    <mvt:assign NAME="l.settings:loaded_canonical_url" value="'https://' $ g.domain:name $ l.loaded_canonical_uri:uri" />

    Justin Sims
    216digital
    Cleveland Area - Code and Design
    https://216digital.com/

    Comment

    Working...
    X