zenphoto forums » Zenpage

Zenpage "pages" for more layouts

(8 posts)
  1. Zenphoto support team
    fretzl

    Moderator
    Joined: Sep '08
    Posts: 550

    Is it somehow possible to use the Zenpage "pages" functionality to have different pages render in a totally different layout without the use of codeblocks and extra content.
    I can do only somuch with codeblocks and extra content.

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  2. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,501

    You can of course add checks within the pages.php theme page to render certain pages with a different layout / different css using the object model. Checks like `if($_zp_current_zenpage_page->getTitlelink() == "<page desired>" {
    do something
    } else {
    do something else
    } `

    or if you want quite a lot different layout use the switch() function for that.

    You can also use normal other custom pages if you pass the titlelink of a page. Using the object model you basically can call a page where ever you want. However that would be outside the normal Zenpage context then.

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  3. Zenphoto support team
    fretzl

    Moderator
    Joined: Sep '08
    Posts: 550

    Thanks @acrylian!

    However, I was thinking of someting else.
    Say you make a new custum theme page with a different layout.
    (different from pages.php)
    And then in in the admin -> pages you could choose in which page your content would be displayed.

    Just thinking out loud :-)

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  4. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,501

    Hm, you can do that actually you just have to pass the titlelink to that page and create a page object. You will however get a different url like zenphoto/page/<name of your custom page>/<possible page titlelink>. You probably could even create a custom option for this.

    I think if we would do such a feature it would/should be like the album themes to stay on one kind of behaviour for all items.

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  5. Zenphoto support team
    fretzl

    Moderator
    Joined: Sep '08
    Posts: 550

    If you think this could be a sensible feature I'd be happy to sponsor it :-)

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  6. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,501

    I would have at least an idea how to do this similar to your first idea (e.g. using pages.php as a wrapper to load other theme pages).

    That could automatically load a script page with for example the name pages-<titlelink of the page to use it>.php if it exists. But I see that a selector might be more convenient for reusing layouts, I think that might be possible as a plugin (but will require the theme to be setup correctly).

    If you like sent an e-mail.

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  7. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,818

    Probably you can do this already by creating a filter attached to the load_theme_script filter.

    This filter is applied just prior to loading the script from the theme for the particular object. Your filter would check to see if it is loading a page and substitute a different script name for the one passed.

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #
  8. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,501

    Good idea, that filter is ideal for that.

    Don't forget to read the Forum rules and usage resources
    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.