• 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.

[XF1] How to place custom Item Fields in templates?

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
 
Bob, I am back and I have been spending a lot of time trying to get the output html box to output something correctly. You tried to help me previously, but your page didn't help or explain in a way I could understand. I can't find what I am looking for here or at xf. I attached what I have. I want to output anchor text to the url. Can you link me to a page that will show me how this box works? I know HTML/CSS, but as my opening thread showed...I still have no idea why the HTML Output box won't accept HTML. It seems straight forward, but it's not. What string do I put there? I know xf has it's own language, but I don't speak it and I can't find a dictionary.
View attachment 2601

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>
 
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>
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.
 
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
 
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.
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)));
 
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)));
Using $valueRaw fixed my problem with the link being all messed up :)
 
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.
 
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
 
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:
Back
Top