1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Self Placement of Fields

Discussion in 'Showcase Support' started by Jaymz, Oct 7, 2015.

  1. Jaymz

    Jaymz New Member AMS Premium Showcase

    Anyway I can get a starting point on what templates to edit to place custom fields below the 'tab 1' container? I searched the forums, but maybe not hard enough :(

    TIA.
     
  2. Bob

    Bob Developer Staff Member

    Template: nflj_showcase_item

    That is the MAIN template for the ITEM itself (its very complex, but still fairly easy to modify if you know what you are looking for). Tab 1 is part of what is called a TAB CONTAINER. A Tab Container is made up of TWO Parts (upper, which is the navigation part and lower which is the content part). You don't need to be concerned with the UPPER, only the LOWER.

    Lets find the LOWER PART which contains the tabs 1-5 content containers.. Scroll down the template until you see this (its about a 3rd of the way down)

    HTML:
            <ul id="showcasetabcontainer">
    Right after it will be the Container for TAB 1 Content... There are THREE possible content outputs on TAB 1. The first are the Custom Fields designated for Display on Tab 1. The 2nd is the EDITOR content for Tab 1 and the 3rd is the GALLERY (when set to display on Tab 1). You can add HTML and xen syntax code before or after each of these 3 blocks (however, the code needs to be inside the <li id="tab1"> element).

    HTML:
                <li id="tab1">
                    <xen:include template="nflj_showcase_item_field_group">
                        <xen:set var="$fieldGroup" value="tab1" />
                        <xen:set var="$extraFieldClass" value="tab1" />
                    </xen:include>
    
                    <xen:if is="{$category.tab1_editor}">
                        <div class="primaryContent">   
                            <article><blockquote class="messageText ugc baseHtml">{xen:raw $item.message}</blockquote></article>
                        </div>
                    </xen:if>
    
                    <xen:if is="({$item.attachments} || {$xmgAlbum.xmgMedia}) && {$item.displayGalleryT1}">
                        <div class="primaryContent">
                            <xen:if is="{$item.gallerytype} == 'custom'">
                                <xen:include template="nflj_showcase_item_custom_gallery" />
                            <xen:else />
                                <xen:include template="nflj_showcase_item_image_gallery" />
                            </xen:if>   
                        </div>   
                    </xen:if>
                </li>
    REMEMBER, if you screw up, you can always revert the template back to original.
     
  3. Bob

    Bob Developer Staff Member

    btw, this is the Tab 1 Custom Fields Block..
    HTML:
                    <xen:include template="nflj_showcase_item_field_group">
                        <xen:set var="$fieldGroup" value="tab1" />
                        <xen:set var="$extraFieldClass" value="tab1" />
                    </xen:include>
    If you want to move it from displaying at the TOP of Tab 1 to displaying at the bottom, just flip flop the Editor Block and the Custom Fields block like this..
    HTML:
                <li id="tab1">
                    <xen:if is="{$category.tab1_editor}">
                        <div class="primaryContent">   
                            <article><blockquote class="messageText ugc baseHtml">{xen:raw $item.message}</blockquote></article>
                        </div>
                    </xen:if>
    
                    <xen:include template="nflj_showcase_item_field_group">
                        <xen:set var="$fieldGroup" value="tab1" />
                        <xen:set var="$extraFieldClass" value="tab1" />
                    </xen:include>
    
                    <xen:if is="({$item.attachments} || {$xmgAlbum.xmgMedia}) && {$item.displayGalleryT1}">
                        <div class="primaryContent">
                            <xen:if is="{$item.gallerytype} == 'custom'">
                                <xen:include template="nflj_showcase_item_custom_gallery" />
                            <xen:else />
                                <xen:include template="nflj_showcase_item_image_gallery" />
                            </xen:if>   
                        </div>   
                    </xen:if>
                </li>
     
  4. Jaymz

    Jaymz New Member AMS Premium Showcase

    Thanks bud. 10-4 and we're rockin.
     
    Bob likes this.
  5. Jaymz

    Jaymz New Member AMS Premium Showcase

    Hi Bob,

    Did the structure for the nflj_showcase_item change with the latest update? I reverted the template back after I updated to address a couple of items and noticed the code block for tab 1 looks a bit like this now. I tried to swap out the field_group template output and the editor output similar to what you show above, but since the structure is a bit different, it seems I can't move the editor output so that the description is above the custom fields. Any ideas?

    Thanks,

    Jaymz

    Code:
    <li id="tab1">
                    <div class="primaryContent">  
                        <article><blockquote class="messageText ugc baseHtml">
                            <xen:include template="nflj_showcase_item_field_group">
                                <xen:set var="$fieldGroup" value="tab1" />
                                <xen:set var="$extraFieldClass" value="tab1" />
                            </xen:include>
    
                            <xen:if is="{$category.tab1_editor}">{xen:raw $item.message}</xen:if>
                        </blockquote></article>
                    </div>
    
                    <xen:if is="({$item.attachments} || {$xmgAlbum.xmgMedia}) && {$item.displayGalleryT1}">
                        <div class="primaryContent">
                            <xen:if is="{$item.gallerytype} == 'custom'">
                                <xen:include template="nflj_showcase_item_custom_gallery" />
                            <xen:elseif is="{$item.gallerytype} == 'fotorama'" />
                                <xen:include template="nflj_showcase_item_fotorama_gallery" />
                            <xen:else />
                                <xen:include template="nflj_showcase_item_image_gallery" />
                            </xen:if>  
                        </div>  
                    </xen:if>
                </li>
    
     
  6. Bob

    Bob Developer Staff Member

    Yes, its changed, but it is still easy to flip flop....

    replace this....
    HTML:
                    <div class="primaryContent"> 
                        <article><blockquote class="messageText ugc baseHtml">
                            <xen:include template="nflj_showcase_item_field_group">
                                <xen:set var="$fieldGroup" value="tab1" />
                                <xen:set var="$extraFieldClass" value="tab1" />
                            </xen:include>
    
                            <xen:if is="{$category.tab1_editor}">{xen:raw $item.message}</xen:if>
                        </blockquote></article>
                    </div>
    with this...
    HTML:
                    <div class="primaryContent"> 
                        <article><blockquote class="messageText ugc baseHtml">
                            <xen:if is="{$category.tab1_editor}">{xen:raw $item.message}</xen:if>
    
                            <xen:include template="nflj_showcase_item_field_group">
                                <xen:set var="$fieldGroup" value="tab1" />
                                <xen:set var="$extraFieldClass" value="tab1" />
                            </xen:include>
                        </blockquote></article>
                    </div>
     
  7. Jaymz

    Jaymz New Member AMS Premium Showcase

  8. Bob

    Bob Developer Staff Member

    You are editing the ITEM VIEW template. You need to edit the CREATE and EDIT FORMS if you want to change the order on those. The Create and Edit Forms are MUCH different. The examples in this thread are ITEM VIEW related, not Create & Edit Form related.

    nflj_showcase_item = what users see when viewing the item
    nflj_showcase_item_create = the form you see when creating an item
    nflj_showcase_item_edit = the form you see when editing an item
     
  9. Bob

    Bob Developer Staff Member

    Here is an example of the EDIT FORM code: nflj_showcase_item_edit

    This is a block of code related to TAB 1 on the EDIT FORM. The fields display ABOVE the editor (as that is how they display on the frontend)
    HTML:
        <fieldset>
            <xen:if is="{$item.tab1_description}">
                <dl class="ctrlUnit">
                    <dt></dt>
                    <dd>{xen:raw  $item.tab1_description}</dd>
                </dl>
            </xen:if>
    
            <xen:if is="{$customFields.tab1}">
                <xen:foreach loop="$customFields.tab1" value="$field">
                    <xen:include template="custom_field_edit" />
                </xen:foreach>
            </xen:if>       
    
            <xen:if is="{$item.tab1_editor}">
                <dl class="ctrlUnit">
                    <dt>{$item.tab1_name}</dt>
                    <dd>{xen:raw $editorTemplate}</dd>
                </dl>
            <xen:else />
                <input type="hidden" name="message" value="{$item.message}" />
            </xen:if>   
    
        </fieldset>

    Here is the above code with the fields output placed below the editor output.
    HTML:
        <fieldset>
            <xen:if is="{$item.tab1_description}">
                <dl class="ctrlUnit">
                    <dt></dt>
                    <dd>{xen:raw  $item.tab1_description}</dd>
                </dl>
            </xen:if>
    
            <xen:if is="{$item.tab1_editor}">
                <dl class="ctrlUnit">
                    <dt>{$item.tab1_name}</dt>
                    <dd>{xen:raw $editorTemplate}</dd>
                </dl>
            <xen:else />
                <input type="hidden" name="message" value="{$item.message}" />
            </xen:if>   
    
            <xen:if is="{$customFields.tab1}">
                <xen:foreach loop="$customFields.tab1" value="$field">
                    <xen:include template="custom_field_edit" />
                </xen:foreach>
            </xen:if> 
        </fieldset>
    You'd need to do the same to ALL the Tabs blocks of code AS WELL AS do the same thing for the CREATE TEMPLATE.
     
  10. Jaymz

    Jaymz New Member AMS Premium Showcase

    I'm sorry. I knew that and just had a moment. Thanks for the help!
     
  11. Joe Link

    Joe Link New Member AMS Premium CAS Premium RMS Premium SC Premium

    @Bob any way we can get this to work below the thread view header?

    Here's how I have it displayed on the item page, and I'd like to copy it (if possible).

    upload_2016-6-7_16-50-29.png
     
  12. Bob

    Bob Developer Staff Member

    Take a look at how I am doing the gallery for the Thread Header (looks at the showcase thread head templates). That should give you an idea on how to do it. You can't use the Item sidebar template in a thread (the data isn't exposed and even if it was, the variable names would be different).
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.