Skip Navigation

[Resolved] update for inserting views into content template? (adds new line)

This support ticket is created 8 years ago. 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.

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)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by jimP 8 years ago.

Assisted by: Luo Yang.

Author
Posts
#381404

Please see previous thread here:

https://toolset.com/forums/topic/inserting-views-into-content-template-starts-new-line/

I'd appreciate an update, as I don't yet see a raw views output option.

Specifically, what we are doing this this:

(1) We have a many-to-many CPT relationship (involving a shared child CPT)
(2) We are displaying a single record for one CPT primarily involving fields on that CPT, but also a field on the related CPT
(3) This field on the related CPT is accessed using a view
(4) This view is then inserted into the single content template

Please see the other thread for screenshots of the problem: essentially since a views output is now wrapped in HTML (as of perhaps 6 months ago?), a new line is inserted, thus content template code like this:

<strong>Researcher(s): </strong>[wpv-view name="Project Record Students"]<br />

cannot display all on one line. That is our goal.

Many thanks,

Jim P.

#381459

Dear Jim,

I checked your previous thread in our to-do list, it is still in under development status, so there isn't " raw views output" option within Views.

I assume we are talking about the problem page:
hidden link
I can see the extra HTML div tags are being output, for example:

<div id="wpv-view-layout-241-CPID163" class="js-wpv-view-layout js-wpv-layout-responsive" data-viewnumber="241-CPID163" data-pagination="{"ajax":"false","effect":"fade","duration":500,"stop_rollover":"false","cache_pages":true,"preload_pages":true,"pre_reach":1,"spinner":"default","spinner_image":"<em><u>hidden link</u></em>","callback_next":"","manage_history":"on","has_controls_in_form":"off","max_pages":0,"page":1}" data-pagepermalink="/overseas/view-all-student-projects/?wpv_view_count=241-CPID163&wpv_paged=1">

	
	
         
         &nbsp;<a href="<em><u>hidden link</u></em>">India Fall 2015</a>&nbsp;&nbsp;&nbsp;&nbsp;
		

	
	
</div>

Does the workaround works for you?
https://toolset.com/forums/topic/inserting-views-into-content-template-starts-new-line/#post-347882

And here is another workaround by using custom shortcodes:
https://toolset.com/forums/topic/unable-to-compare-views-output-in-conditional-output/#post-347444

Hope it help

#382276

Okay, the custom shortcode solution seems to work!

Many thanks,

Jim P.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.