1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

category_view as club page

Discussion in 'Styling and Customization Questions' started by Morgain, Dec 21, 2011.

  1. Morgain

    Morgain Well-Known Member

    I want to develop the category_view page - when you click a Category title and get a page of contents in that Category.
    I think this page has a lot of potential.

    The main issue is to create ALTERNATE category_view pages so the structure is the same but more components change according to which Category it is.

    Here's a mockup of two different Category_View pages:

    Category_view page DOUBLE.png

    Differences to code -

    1. Page titles are different colours. This follows on Jake Bunce styling of the Category Title on the top level node tree.
    1A. Background of the Title boxes are different colours. Same as Jake Bunce styling of the Category bar gradient on the top level node tree.
    (the size, border and shadow of the title box is global and can be set in Style Groups already.)

    2. Title graphic. Same as the Category icon on Jake Bunce's individualisedCategory bars. However this is set separately as it can be desirable to have a more detailed graphic, similar but richer, here. Or add a seasonal surprise!

    3. Category Description taken from the Category bar on the node tree.

    4. Title colour of the threads or subforum titles is same as the Page Title.

    5. Moderator box to left to display Avatar and Username linked to Membercard) for these forums.

    6. Section of page below the threads/ subforums for further content.

    Most of this already exists with Jake's coding in EXTRA.css
    just need to draw it on to this page.

    The central issue to start is to tell this page to allow different content - colours, text, graphic, moderator display, depending on which category it is.

    Look forward to my next lesson!
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Morgain likes this.
  3. Morgain

    Morgain Well-Known Member

    Jake thank you as always for speed and generosity.

    I can now place an image at the top of the category page.
    But it also shows the image inherited from PAGE_CONTAINER which I had already placed next to the title.
    How can I tell category_view NOT to display the PAGE_CONTAINER title image?

    Also I don't understand how to place the image.
    I made a table like this:

    <table width=100%><tr>
    <td><!-- CATEGORY IMAGE -->
    <xen:if is="{$category.node_id} == 41">
    <img src="styles/default/page41-celtic.png" />
    <td><!-- TITLE -->
    But the category image still shows up below the title on a different row, instead of on the same row on the left of the title.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    For your purposes I think you want to get rid of xen:title, leaving only the category title. Replace this:

    With this:

  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add this code to category_view:

    <xen:container var="$catImage">1</xen:container>
    Then edit PAGE_CONTAINER and surround your image with this condition:

    <xen:if is="!{$catImage}">
    That will hide the PAGE_CONTAINER image on category_view pages (when that xen:container line is included).
  6. Morgain

    Morgain Well-Known Member

    It didn't like that!

    Yes I do want to get rid of the xen title display. It would be easier to just build my own on a conditional for that page.
    But isn't the xen title line necessary to identify the page?
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    xen:title passes information to the container. If you want to display the title in your template then just use {$category.title}.

    The category_view template already contains a xen:title tag at the top. Leave that one there.
  8. Morgain

    Morgain Well-Known Member


    is not accepted. The template won't load with it without the full
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It works for me. Can you post your category_view template so I can look at the code?

Share This Page