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

XF 1.2 Responsive template modifications

Discussion in 'Styling and Customization Questions' started by giorgino, Sep 26, 2013.

  1. giorgino

    giorgino Well-Known Member

    Hi all :)

    I'm making some changes to my template modifications for make more responsive my sites.

    One of this is:

    Find:
    Code:
    <xen:h1>{$xenOptions.boardTitle}</xen:h1>
    Replace:
    Code:
    <div class="visibleResponsiveFull hiddenResponsiveWide hiddenResponsiveNarrow hiddenResponsiveMedium">
    <xen:h1>{$xenOptions.boardTitle} con {xen:number $boardTotals.users} Membri Registrati</xen:h1>
    </div>
    but don't work. What's wrong?
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    The xen:h1 tag isn't evaluated immediately when its called. The <h1> that is printed out when you call <xen:h1 /> is actually contained in the template PAGE_CONTAINER.
     
  3. giorgino

    giorgino Well-Known Member

    mmm.... so how can I workaround this? :confused:
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    Modify the PAGE_CONTAINER to include your template edit.
     
    giorgino likes this.
  5. giorgino

    giorgino Well-Known Member

    Is this the piece of code to customize? :confused:

    Code:
                            <xen:hook name="page_container_content_title_bar">
                            <xen:if is="!{$noH1}">                       
                                <!-- h1 title, description -->
                                <div class="titleBar">
                                    {xen:raw $beforeH1}
                                    <h1><xen:if
                                        is="{$h1}">{xen:raw $h1}<xen:elseif
                                        is="{$title}" />{xen:raw $title}<xen:else
                                        />{$xenOptions.boardTitle}</xen:if></h1>
                                   
                                    <xen:if is="{$pageDescription.content}"><p id="pageDescription" class="muted {$pageDescription.class}">{xen:raw $pageDescription.content}</p></xen:if>
                                </div>
                            </xen:if>
                            </xen:hook>
     
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

  7. giorgino

    giorgino Well-Known Member

    I'm testing simple char insert without success... Any advice?
     
  8. Jeremy

    Jeremy XenForo Moderator Staff Member

    What are your modifications?
     
  9. giorgino

    giorgino Well-Known Member

    I simply tested something like:
    Code:
    <xen:hook name="page_container_content_title_bar">
                            <xen:if is="!{$noH1}">                  
                                <!-- h1 title, description -->
                                <div class="titleBar">
                                    {xen:raw $beforeH1}
                                    <h1><xen:if
                                        is="{$h1}">{xen:raw $h1}<xen:elseif
                                        is="{$title}" />{xen:raw $title}<xen:else
                                        />{$xenOptions.boardTitle}test</xen:if></h1>
                              
                                    <xen:if is="{$pageDescription.content}"><p id="pageDescription" class="muted {$pageDescription.class}">{xen:raw $pageDescription.content}</p></xen:if>
                                </div>
                            </xen:if>
                            </xen:hook>
    Look at line: />{$xenOptions.boardTitle}test</xen:if></h1>

    But in this way, no word 'test' appear after the board title...
     
  10. Jeremy

    Jeremy XenForo Moderator Staff Member

    That section is only used if the template you are viewing (specifically the page in general) doesn't utilize <xen:h1> of <xen:title> to set the H1 value. You'll either want to place your test outside of the <xen:if> completely, or use the statement 2 lines above it. If you want to hide it in responsive, just add your classes to the div that contains the <h1>.
     
  11. giorgino

    giorgino Well-Known Member

    Something like this?
    Code:
    />{$xenOptions.boardTitle}</xen:if>test</h1>
    The system don't apply my template mod... :cry:
    Schermata 2013-09-26 alle 16.44.04.png
     
  12. Jeremy

    Jeremy XenForo Moderator Staff Member

    Yes. Just edit the template directly, your search found nothing that matched and hence didn't apply the modification.
     
  13. giorgino

    giorgino Well-Known Member

    Please explain me...
    Testing the mod, the change is detected...

    Schermata 2013-09-26 alle 16.58.08.png

    Why do I have to modify the template directly?
     
  14. Jeremy

    Jeremy XenForo Moderator Staff Member

  15. giorgino

    giorgino Well-Known Member

    I know (great @Chris Deeming tutorial!) but I use this modification as addon across my six xf boards :)
    For me it's really crucial to use xf TM for that basic template mods.
     
  16. Jeremy

    Jeremy XenForo Moderator Staff Member

    Disable modifications until it wants to apply.
     
  17. giorgino

    giorgino Well-Known Member

    Found it! It's another of my template mods that conflict! :)

    Now I find the correct mod and post here the result for future users ;)
    Thank you for now!
     
  18. giorgino

    giorgino Well-Known Member

    uhmm... the {xen:number $boardTotals.users} variable return 0
     
  19. Jeremy

    Jeremy XenForo Moderator Staff Member

    You'll need to make sure that $boardTotals is available to the template you are attempting to place it in.
     
  20. giorgino

    giorgino Well-Known Member

    ehmm... how? :rolleyes:
     

Share This Page