problem with news multiple layouts + alpha order

hello
I am having trouble with the plugin multiple_layouts and news.

I have created a newscat.php and newsart.php which i select when i add a category and article but it works only for categories

Any idea what I can do?

Also, how can i sort news article by alphabetical order instead of by published date?

Thanks

Pat

Comments

  • acrylian Administrator, Developer
    Please best don't mix topics in one post. It can easily get a bit inconvenient.

    1) I am not sure what does not work. What exactly did you do? You can assign layouts to categories and articles independently.

    2) News articles follow blog style so it is always latest to oldest. If you wish a different order you need to code that via the object model right at the beginning on the theme files.
  • To uses multiple_layouts plugin for my articles I created new templates based on news.php : newscat.php and newsart.php

    When i create a news category if i select the newscat template it works fine but it doesn't work for news articles.

    I create a new article and no matter if i select templates : newsart or newscat, my articles always use the regular news.php template.

    In other words I can't apply my modified news template to the articles, only to categories

    Pat
  • acrylian Administrator, Developer
    I just tried and assigning templates to categories and articles individually does work for me. Are you sure you enabled articles and categories in the plugin options?
  • yes, everything is enabled, image, articles etc.
  • acrylian Administrator, Developer
    In case you are confused by this: The layout selector on news articles suggests it would inherit a layout from a category. That is actually not the case and written correctly in the main plugin doc. Because a article can be assigned to multiple categories it would never be clear which category that should be. So articles always require individual assignments of layouts.
  • yes but it doesn't work, as i explaine, i have created 2 layouts one for the category the other for articles but it works only for category
  • could you let me know what file exactly I have to check to modify the sort order to have news alphabetical order?

    Where exactly do i find this : object model right at the beginning on the theme files. ?

    thanks
  • acrylian Administrator, Developer
    Sorry, I cannot reproduce any issue with the multiple layouts plugin. Review your error logs.

    Zenpage item class objects have the methodes `setSortDirection()` and `setSortType()`
    Info about the object model in general here:
    http://www.zenphoto.org/news/zenphotos-object-model-framework
    Documentation of the Zenpage classes related:
    http://www.zenphoto.org/documentation/plugins/zenpage/ZenpageCategory.html
    http://www.zenphoto.org/documentation/plugins/zenpage/Zenpage.html

    This is a bit advanced coding.
  • there are no errors in my logs....

    I checked all the docs you sent me, i just started using this program and I am not familiar at all with, reading all this doesn't tell me anything..

    You wrote it and must know exactly where i have to go to modify sort_order for the news....this is the information I ask.
  • acrylian Administrator, Developer
    Well, you need to invest a bit time to get familiar and you need at least basic coding knowledge to do so in this case.

    Theme page `news.php` put at the beginning in the `head` for example:
    `
    $_zp_zenpage->setSortDirection($value, 'news'); where $value is true or false depending if you want descending or ascending order
    $_zp_zenpage->setSortType('title', 'news'); // sorting by title
    `
  • Thanks for the help, I agree it's always better to learn how to use the software but it gets way easier with an example.

    I had no idea i could add any code at the top of the file so i could have read the docs for life....

    It's working now for alphabetical order, i keep searching why multiple_layouts don't work

    thanks
  • Could you let me know what includes the sidebar on news.php?

    I created custom templates for news articles to get rid of this sidebar on some pages, for this I deleted the code :

    <?php if ($zpbase_newsstyle == 'blog-style') include ('inc/sidebar.php'); ?>

    BUT this sidebar shows up anyway on my custom news articles templates (not on the news category), so there is something adding it but what?
  • found it, the sidebar was called twice on the page !
  • acrylian Administrator, Developer
    I understand that an example is often helpful. You can generally do all sorts of custom coding on theme files. Besides a general base structure of required files Zenphoto themes leave a lot freedom what to do how.
Sign In or Register to comment.