Skip Navigation

[Résolu] Simple @ sign output

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

Display multiple instances textarea field "location", format with HTML P tag + @.

Solution:

Since the field "location" is a custom textarea field, it will output extra HTML P tags by default, you can disable it by setup the output="raw" attribute, for example:

https://toolset.com/forums/topic/simple-sign-output/#post-1098401

Relevant Documentation:

https://toolset.com/documentation/customizing-sites-using-php/functions/#textarea

This support ticket is created Il y a 6 années et 3 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Ce sujet contient 6 réponses, a 2 voix.

Dernière mise à jour par Luo Yang Il y a 6 années et 2 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1094666

Jas
screenshot view for health search.png

Hi,

Following the advise I got last time, I was able to fix all the issues that arose from problems using Divi together with Toolset; which resulted in messed up html/shortcodes (which took me forever to produce in the first place). Now it seems like I can fix when needed.
However the last content template to mess up, I don't think happend before, so I didn't have the shortcodes/html documented to fix.
I've added the @ sign as it shows up in the view as per attached screenshot, however, I need the @ sign to appear next to each location on the same line (while keeping space between each location). I know this will have a exceedingly simple answer, but I don't know it:p

Also I had the link title text showing up in my link color that I had selected, and now it's not. how do I get that back?

thanks so much!

see on lien caché

#1094677

Hello,

Please backup your website, and provide website credentials in below private message box, I need to test and debug it in a live website. thanks

#1094752

Thanks for the details,

Q1) I need the @ sign to appear next to each location on the same line

since the field "location" is a custom textarea field, it will output extra HTML P tags by default, you can disable it by setup the output="raw" attribute, for example, edit the content template:
lien caché

Edit the codes to:

[wpv-for-each field="wpcf-location"]@[types field='location' separator='' output="raw"][/types][/wpv-for-each]<br/>

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#textarea
output:
'raw' | 'normal'(default)
‘raw’=Display raw data stored in DB. No other formatting attributes (e.g. custom separator) will be respected.

‘html’=Wrap data in HTML.

Q2) Also I had the link title text showing up in my link color that I had selected, and now it's not. how do I get that back?

It needs a little CSS codes, for example:
1) edit the content template:
lien caché

Add a custom CSS class name to the post title:
<h3 class="my-title">[wpv-post-link]</h3>

2) Edit view, in section "Loop Editor", click "CSS Editor", add below CSS codes:

.my-title a{
color:#00d6d2;
}

And test again.

#1097368

Jas
at sign spacing and separate line.png

Yes, that gets the @ sign on the same line as the location. But for some reason when I add paragraph tags/line breaks to the shortcode it doesn't work (it actually worked once, and then 15 minutes later was reverted back!). Can you please try to add these tags as I still need:

1) Space between @ sign and location
2) each location on their own line.
3) Space between final location and star ratings.

Please see screenshot.

#1098401

I have modified the codes in your website as below:

...
[wpv-for-each field="wpcf-location"]<p>@ [types field='location' separator='' output="raw"][/types]
[/wpv-for-each]<br>
...

Please test again, check if it is what you want

#1100256

Jas

Thanks again Luo Yang! Appreciate it!

#1100877

You are welcome