1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to 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.

Custom Download Button

Discussion in 'Showcase Support' started by mauzao9, Dec 20, 2014.

  1. mauzao9

    mauzao9 Member Showcase Sportsbook

    Hello there.

    There was some information about a custom field that allows a download button, the code was:
    Code:
    <label for="LoginControl" id="SignupButton"><a href="{$value}" class="inner">Download Now</a>/label>
    However, the {$value} breaks its layout every time, without it, the button display correctly, what is wrong?
    Right now when i try to mouse over it, returns:
    Code:
    http://mysite.com/<a href=
     
    Last edited: Dec 20, 2014
  2. Bob

    Bob Developer Staff Member

    instead of {$value} try either {$valueSC} or {$valueRaw} Showcase has 3 different "value" options.


    PHP:
                    $valueRaw htmlspecialchars(XenForo_Helper_String::censorString($value));
                    
    $valueSC nl2br(htmlspecialchars(XenForo_Helper_String::censorString($value)));
                    
    $value XenForo_Template_Helper_Core::callHelper('bodytext', array($value)); 
     
    mauzao9 likes this.
  3. Bob

    Bob Developer Staff Member

    Here is a more detailed explanation....

    {$valueSC} within Showcase is the same as {$value} is in User fields, but NOT the same as {$value} is in the Resource Manager.
    {$valueRaw} in showcase is the same as {$valueRaw} is in the Resource Manager (and {$valueRaw} is not available in user fields).
    {$value} in showcase as same as {$value} in the Resource Manager (which is different than {$value} is in User Fields).

    User Fields: {$value}
    User Fields: ($valueRaw) <--- no such thing

    RM: {$valueRaw} is similar, but not 100% the same as {$value} is within User Fields
    RM: {$value} is NOT the same as {$value} is within User Fields

    SC: {$valueRaw} is the same as the RM
    SC: {$value} is the same as the RM
    SC: {$valueSC} is the same as {$value} is for User Fields.
     
  4. mauzao9

    mauzao9 Member Showcase Sportsbook

    Oh many thanks that is working.

    My difficulty now is place it exactly where i want, i see that thread about call it on templates will try to understand it!
     
    Bob likes this.
  5. mauzao9

    mauzao9 Member Showcase Sportsbook

    Well unfortunately i can't get it, i want to display it on another position the tab1 itself, but not at top, after the actual item content, not before.
     
  6. Bob

    Bob Developer Staff Member

    edit the template: nflj_showcase_item

    find this block of code:

    place YOUR code where I have the sentence "place your modified code here"

    HTML:
            <ul id="showcasetabcontainer">
                <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>
    
    place your modified code here
    
                    <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>
     
    mauzao9 likes this.
  7. mauzao9

    mauzao9 Member Showcase Sportsbook

    Thanks, it works! It's pretty much there just a thing, is it possible to display this field on the tab1, without force "self place fields"? Not sure if i can show the option on tab1, hide the actual tab1 and use the template edit one.
     
  8. Bob

    Bob Developer Staff Member

    Locaation: Tab 1 = Above the Content

    What you want to do (below the content) is only doable via the template edit
     
  9. mauzao9

    mauzao9 Member Showcase Sportsbook

    Yes the template edit i made works to call it where i want, what i wish is the option when creating one actual showcase item to be not on the "Self Placement" tab.
    For now i think i tweaked it a bit by using the "Own Tab", it displays the button under the content and on a tab but displays the option on the main create page. ^^
     
  10. Bob

    Bob Developer Staff Member

    http://xenaddons.com/threads/create-edit-item-page-redesign.1067/ I've removed the TABS on the Create and Edit forms as they were causing too many problems.
     
  11. mauzao9

    mauzao9 Member Showcase Sportsbook

    Well hyped for next update then, interesting features

    Now that i poked more into the script, one suggestion would be have a look at thumbnail system for the grid system, providing something like this or a simpler way to adapt images to several sizes without cut them like it does now.
     
  12. Bob

    Bob Developer Staff Member

    Post XF 2.0, I plan to redo a bunch of stuff. Not going to waste much time redesigning the wheel when XF 2.0 is in development tho. Hope you understand :)
     
  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.