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.

How to place custom Item Fields in templates?

  1. beanfan78

    beanfan78 Member Article Mgmt System EA Showcase EA

    I am probably ask for the world, but the worse thing anyone can say is no I suppose. These are the things I am working towards. My goal is to make Showcase look aesthetically pleasing for each of the submissions. I can mock things up, but making them into code is my weakness. I promise in 2017 I will take the whole year to learn code after I retire from the Air Force. Till then I have to continue adding noob questions.
    youtube-output-3.jpg
     
  2. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    For the html, you have entered the field id into the html code, you only need to enter $valueUrl
    <a href="{$valueUrl}" target="_blank">Check Out Our Site</a>
     
  3. beanfan78

    beanfan78 Member Article Mgmt System EA Showcase EA

    No I tried this too. I have tried {$value}, {$valueUrl}, and the Field ID. The screenshot was just me last shot at getting it to work. I copy and pasted what you wrote and still didn't work.
     
  4. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    Looking at mine and its basically same as what you got, apart from i use the sidebar, but i have just rechecked one my listed items and it is giving a fully link now (not sure if thats due to another add-on or something thats happen with a showcase update.)

    I get links like this now
    Code:
    https://www.yourpshome.net/%3Ca+href%3D%22https%3A%2F%2Fdatabase.yourpshome.net%2Fscea-rewards%2Fhome-spaces%2Flocoroco-mui-mui-crusier%22+rel%3D%22nofollow%22+class%3D%22externalLink%22+target%3D%22_blank%22%3Ehttps%3A%2F%2Fdatabase.yourpshome.net%2Fscea-rewards%2Fhome-spaces%2Flocoroco-mui-mui-crusier%3C%2Fa%3E
     
  5. Bob

    Bob Developer Staff Member

    There is ALSO {$valueRaw} and {$valueSC}.

    {$valueRaw}
    PHP:
    $valueRaw htmlspecialchars(XenForo_Helper_String::censorString($value));
    {$valueSC} (This is actually how the XF Custom User fields {$value} is formatted.
    PHP:
    $valueSC nl2br(htmlspecialchars(XenForo_Helper_String::censorString($value)));
     
    C.Birch likes this.
  6. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    Using $valueRaw fixed my problem with the link being all messed up :)
     
  7. Bob

    Bob Developer Staff Member

    I really need to update the phrase to include those other variables.
     
    C.Birch likes this.
  8. beanfan78

    beanfan78 Member Article Mgmt System EA Showcase EA

    I used {$valueRaw} on it and it worked. Is that it though? Just that one variable? I would like to do more if possible but where can you find some kind of "this is how custom field HTML outputs work" page? If I can get to the info then I won't have to ask these questions. I appreciate the tip on the new phrase. There is a lot that I would like to fix and try to add using this block.
     
  9. beanfan78

    beanfan78 Member Article Mgmt System EA Showcase EA

    Okay, I tried all 6 of the {$xxxxx} fields in my link. I simply was trying to have the type in the Twitter handle without the @ symbol. I copied and pasted my results in each ignoring the >output< part. Nothing helped to create a clickable hypertext to the Twitter profile. The good news is that the above helpedsolove one issue. Here is my record:

    {$value} = https://twitter.com/<a href=
    Looks on Page: https://twitter.com/twittername" target="_blank">@
    Entered in HTML: <a href="https://twitter.com/{$value}" target="_blank">@{$choice}</a>

    {$valueUrl} = https://twitter.com/<a+href="https:...="_blank">https://twitter.com/twittername</a>
    Looks on Page: @
    Entered in HTML: <a href="https://twitter.com/{$valueUrl}" target="_blank">@{$choice}</a>


    {$valueRaw} = https://twitter.com/https://twitter.com/twittername
    Looks on Page:
    Entered in HTML: <a href="https://twitter.com/{$valueRaw}" target="_blank">@{$choice}</a>


    {$valueSC} = https://twitter.com/https://twitter.com/twittername
    Looks on Page: @
    Entered in HTML: <a href="https://twitter.com/{$valueSC}" target="_blank">@{$choice}</a>


    {$choice} = Twitter
    Looks on Page: @
    Entered in HTML: <a href="https://twitter.com/{$choice}" target="_blank">@{$choice}</a>


    {$fieldId} = https://twitter.com/twitter_link
    Looks on Page: @
    Entered in HTML: <a href="https://twitter.com/{$fieldId}" target="_blank">@{$choice}</a>

    combined.png
     
  10. beanfan78

    beanfan78 Member Article Mgmt System EA Showcase EA

    I made a mistake. I didn't realize I still had the full URL in the profile box on the front end. I changed it only to the Twitter username and it works.
    <a href="https://twitter.com/{$value}" target="_blank">@{$value}</a> is correct for what I was doing. Now I just need to figure out font-awesome with this. :p

    I did it! My wife gave me a gold star too! Almost ready for python.

    <a href="https://twitter.com/{$value}" target="_blank" class="fa fa-twitter"> @{$value}</a>

    fa-worked.PNG
     
    Last edited: Mar 12, 2016
    C.Birch and Bob like this.