function to print a link to a page

vincent3569 Member, Translator
hi

is there a function to print a link to a specific page, out of context of this page ?

for example, I want add a link to a page called 'credit' in the footer of my website.

Comments

  • Your question is a little ambiguous. Do you mean a custom page (script)? or a particular Zenpage page?

    For the former there is `printCustomPageURL()` for the latter `printPageLinkURL()`
  • vincent3569 Member, Translator
    hi

    My request was about the 2nd case, so, I needed to use `printPageLinkURL()` function.

    But I am a little bit disapointed.
    printCustomPageURL('Credit', 'credit') gives the following html code :
    `Credit`

    in other hand, printPageLinkURL('credit')gives the following result : `/page/credit`
    the 2 functions don't give a similar result...

    I wish that printPageLinkURL('credit') gives folowwing code :
    `title-of credit-page`

    you could do that ? the printPageLinkURL is unused in the full code of zenphoto 1.4.2.
  • I have no issue with changing this. But I hope other theme developers will step in. Changing the function will make any existing use not work. So even if Zenphoto does not currently use it, some one else might.
  • acrylian Administrator, Developer
    Actually I think as well that url functions should include the full url and not a relative one. But I fear issues as this require quite a lot changes as the get variants should do that as well. Howerver the browser actually will add that itself as well.

    In short maybe the best way is to echo the get variants and add the WEBPATH constant manually as a workaround.
  • Please try the DEV nightly and give feedback. printPageLinkURLis changed to mimic printCustomPageURL
  • vincent3569 Member, Translator
    hi

    I saw the track http://www.zenphoto.org/trac/changeset/9042.
    It seems to be goof for my needs : thanks a lot !

    I will try the NB as soon as possible
  • I hope that is "good" :) If all is well I will retrofit it to 1.4.2. Let me know.
  • Hello,
    I am using Zenphoto version 1.4.2 [8956] (Official Build)
    Current gallery theme: zpFocus_ v1.4.2.
    I have created a (Zenpage) page to use as a sitemap. The links are in an html table. Also, I have links to the Contact page, and others throughout my site, I was wondering if inserting the links manually using a href is the proper way to display links or should I use printPageLinkURL()?
    Thank-you
  • Well, as this thread does state, the `printPageLinkURL()` function in the release is not so useful. If you wish to use it, you should install the nightly build.

    As to your question. It is better to use provided functions than to hand craft the URLs. For instance these fuctions deal with knowledge of the setting of the `mod_rewrite` option and generate cruft free links if it is set but query parameter ones if it is not set.
  • acrylian Administrator, Developer
    If you mean within the Zenpage page content you cannot use PHP at all. Then you need to use tinyZenpage via TinyMCE to include links. Those of course take care of mod rewrite or not but are of course pasted statically so later changes cannot be applied.
Sign In or Register to comment.