Skip Navigation

[Closed] Using Views To Create Popular like wp onclick popup

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.

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 7 years, 11 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#153655

Hi!
I really like the functionality of the first "STAFF" listing on this page:

"<em><u>hidden link</u></em>" 

The SECOND STAFF listing is created with Views. When you click the names, they go to the content template-driven custom post types (staff bios), instead of popping up like the first example on the page.

When I try creating a view for each staff member and inserting into the On Click Popup, On Click Popup is not compatible with Views.

So here's my question: <b>Can I create a popup effect similar to the one in the FIRST Staff Listing using Views? The client needs to be able to add staff and board members and using OnClick Popup, I had to html each windowbox. <b>

Thanks in advance.

Marisa

#153656

hidden link

#154275

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hi Marisa,

I think it is possible with Views to create such a "wp onclick popup"

Please try edit your custom view, in the "Layout HTML/CSS/JS", modify it like this:

...
	<!-- wpv-loop-start -->
   <ul>
      <wpv-loop>
        <li><a href="#inline_demo[wpv-post-id]" rel="prettyPhoto[light_rounded]">[wpv-post-title]</a></li>
        <div id="inline_demo[wpv-post-id]" style="display:none;">[wpv-post-body view_template="my custom content template name"]</div>
      </wpv-loop>
   </ul>
	<!-- wpv-loop-end -->
...

Please replace "my custom content template name" with your custom "content template" name

More help:
https://toolset.com/documentation/views-shortcodes/#wpv-post-body

#154534

Very strangely, this only works if the on click popup is on and also in the widget...what's wrong?

#154552

Is that's what's intended? (see above post).

#154804

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I test the URL you mentioned above:
hidden link

the wp onclick popup seems works fine, and I see a javascripts in your widget:

<script type="text/javascript" charset="utf-8">
  jQuery(document).ready(function(){
    jQuery("a[rel^='prettyPhoto']").prettyPhoto({
overlay_gallery: false, "theme": 'light_rounded', social_tools: false, autoplay_slideshow: false
});
  });
</script>

I think it can resolve the problem you mentioned above. and I suggest you try to put into your HTML head area
More help:

Links a script file to the generated page at the right time according to the script dependencies, if the script has not been already included and if all the dependencies have been registered.
http://codex.wordpress.org/Function_Reference/wp_enqueue_script

The topic ‘[Closed] Using Views To Create Popular like wp onclick popup’ is closed to new replies.