Skip Navigation

[Résolu] Structure of related pages

This support ticket is created Il y a 7 années et 10 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 38 réponses, has 2 voix.

Last updated by AndreG3332 Il y a 7 années et 9 mois.

Assisted by: Nigel.

Auteur
Publications
#416661

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

Screen Shot 2016-07-15 at 15.26.40.png

I'll agree it's confusing, but that's only because of how your client has wanted to set this up in discreet steps which has obliged us to use this somewhat convoluted set up.

You already have the partner name as a link output by the Posts of a partner View, and you can simply add the logo for the partner there. You can use the Fields and Views button to insert it, being sure to set that you are referring to the parent partner post (see screenshot), or set that manually with the id attribute if you add the shortcode manually, like so:

[types field='logo' size='thumbnail' align='none' resize='proportional' id='$partner'][/types]
#417175

HI NIgel,

I have convinced my client to go with more simplified option. Yeh!

Ok the route we will take now is to still have the categories on the home page but then when the categories has been selected it will open a page where all the post for that category will be displayed. This is then where i would need some guidance. She then wants the displayed posts sorted by by partner. In other words she wants the partner name as header , all the posts as excerpts (this i can manage) listed under the partner heading and then the next partner with all their posts listed. This will obviously work with a parametric search TO filter out just one selected partner's post at a time.

I have created a page called Partners posts. where the id 989. Where the final view will be for the post sortedd by the partners will show in.

I have tried in vain to create this view to be workable. This view must in other words display the following:

Partner logo
Partner name

Post title
post body
Category 

Post title
post body
Category  

etc

Partner logo
Partner name

Post title
post body
Category 


Post title
post body
Category 
etc

etc

I am comfortable in setting up the parametric search it is just the view structure for the above that is still tripping me up.

Thx

#417896

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

Hi Andre

What you are describing isn't parametric search as such.

Parametric search provides filters that site visitors can use to narrow down the search results. So for your client if there was a page to show articles you would have filters for the categories and the partners at the top, typically as select boxes or checkboxes. The user selects a category and the results update to show all articles within that category, by all partners. They then select a partner to narrow down the results further. Or they might choose a partner first and then a category. And this imposes no restrictions on articles having multiple categories.

The solution you describe above is just a normal view with two-stage ordering.

So the categories on the home page are set up as before. They won't link to the partner archive page anymore, they will link to a new page that holds the new view, but will still need to pass the category as a url parameter as before.

And your view will need to filter posts by the category using that url parameter, which we have done before.

You will want to return all results, but then order them first by partner name then by post title.

Nice and straightforward, except you currently can't do that in Views.

The next release of Views will add the ability to use two orderby parameters, but only using standard WordPress fields such as post title, post author, post date etc. It won't have the ability to refer to a field from a parent post as an orderby parameter.

I can't remember now if there is a particular reason why partners are custom posts and not site users. If they were users then they could be post authors of their articles and then they would be a perfect fit for the two step ordering coming in the next version of Views (although with testing etc. that is probably still a few weeks away).

In the meantime, the only way to achieve what you describe is by writing a bespoke solution to customise the ordering of the results.

Or... you could add a parametric search instead...

#417909

Hi Nigel,

Thx for your reply. I think i need to put my fate in your hands. Unfortunately i don' think I have a few more weeks.

Ok Let me address your "concerns" and then I am totally in your hands for a solution.

The partners will not be users at all. The partners is basically clients of my client that she writes blogs for. None of them will register on the site. She needs their information just that the readers of the blog can link to their respective blogs and webpages. The readers will be the actual users of this site. That is the reason for going this route.

Ok so basically what you are suggesting is a view that will return the partners details, the blog title and content, and category. This will all be functioning under a parametric search that will search the category and effectively list the partners left in that category and then the partners can be filtered to leave just the post for that partner.

If my understanding is correct this will then mean a view showing partners with a nested view of the posts and categories in the outer view of the partners and the parametric search will then be in the outer view?

#417984

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

First, regarding the partners. They could be registered as users on the site purely for the purposes of assigning them as post authors, they wouldn't even need to know they had been added as users, let alone log-in, and you can create custom user fields to add extra info to their profiles etc.

But. That would help if you had the next version of Views now, which you don't, so let's note that for future reference and put it to one side.

I'm guessing that your client would still like to have the categories on the home page linking to a page that displays articles of that category.

That page will display all articles from any partner (subject to any pagination you add, e.g. to only show 10 posts at a time) and will have a dropdown box to choose a specific partner.

So, on your front page list your categories as before which link to an articles page and include the category url parameter.

Now create a parametric search view that returns posts which will be added to that articles page.

As before we need to use the category url parameter to narrow down our search, but when you add a parametric search view the UI for the query filter is normally hidden. You will have to scroll to the top of the page and click "Screen options", then in the Query section click the Query Filter checkbox.

Now when you scroll down you will be able to add a taxonomy Query filter for categories that is determined by the category url parameter, as we have done before.

Then you need to scroll down to the Filter Editor. Place your cursor between the wpv-filter-control shortcodes and click the New Filter button. This is where you will add your post relationship filter for the parent partner.

Then when you scroll down further you will be at the familiar loop output section where you can directly add your post summary fields or specify a content template which does the same.

So, to sum up.

There is no inner or outer view, just one view, which you will add to a dedicated page.

You are going to use the category url parameter from the links on your home page to pre-select only posts with that category, and your users will have a dropdown box where they can select a partner. You can use the view settings to determine whether the results update with a page refresh or using ajax.

#418680

Hi Nigel,

So close yet so far! Ok i did exactly what you said and lo and behold it is working! I think my last issue has just popped up. I am trying to establish the link from the homepage categories to the articles page where i have the parametric view setup on. My problem is that it shows my link as a link by making it blue but it is not clickable.

My structure is :
View name on article page : "post-with-parametric-search"
The view name on the homepage that show the articles: "Post categories"
the loop of "Post categories"

[wpv-layout-start]
    [wpv-items-found]
    <!-- wpv-loop-start -->
    <table width="100%" class="wpv-loop js-wpv-loop">
    <wpv-loop wrap="4" pad="true">
        [wpv-item index=1]
        <tr>
            <td>
                [wpv-post-body view_template="Home page categories"]
            </td>
        [wpv-item index=other]
            <td>
                [wpv-post-body view_template="Home page categories"]
            </td>
        [wpv-item index=4]
            <td>
                [wpv-post-body view_template="Home page categories"]
            </td>
        </tr>
        [wpv-item index=pad]
            <td></td>
        [wpv-item index=pad-last]
            <td></td>
        </tr>
    </wpv-loop>
    </table>
    <!-- wpv-loop-end -->
    [/wpv-items-found]
    [wpv-no-items-found]
        <strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
    [/wpv-no-items-found]
[wpv-layout-end]

and the Content Template: "Home page categories"
with the loop content being:

<div class="cat-image">
<a href="[wpv-archive-link name='partner']?wpvcategory=[wpv-taxonomy-slug]">[types termmeta="category-image"][/types]</a>
</div>
<div class="cat-heading">  
<p><a href="[wpv-post-url id='43']?wpvcategory=[wpv-taxonomy-slug]">[wpv-taxonomy-title]</a></p>
</div>

the article page id being "43"

So my question where is the blond showing through that it is not a clickable link?

the two applicable url's :
hidden link
hidden link

Thx

#418737

Nigel
Supporter

Languages: Anglais (English ) Espagnol (Español )

Timezone: Europe/London (GMT+01:00)

Hi Andre

Your "Home page categories" content template looks correct to me, except you have not updated the link for the image to match that used for the text (it still points to the partner archive).

I visited the site and observed that the links are not working, though it is not easy to see why.

Extracting just the markup via the browser dev tools it looks well formed (see below):

<tr>
    <td>
        <div class="cat-image">
            <a href="<em><u>hidden link</u></em>"><img alt="" src="<em><u>hidden link</u></em>"></a>
        </div>
        <div class="cat-heading">
            <p><a href="<em><u>hidden link</u></em>">Relationships</a></p>
        </div>
    </td>
...
</tr>

I suspect there is an error in the markup elsewhere on the page causing the problem.

There are a lot of nested divs coming from the theme which the table of links sits inside.

Could you try switching over to twentysixteen and see if the links appear as normal?

I tried to have a look at your site's backend but I think you are working on a different server to the last one you provided creds for.

#419213

HI Nigel,

Ok i have changed the theme to 2016 and then it works. The url of the current site login is hidden link the credentials is the same as the one you have. If it is not obvious i will contact the theme developer to advise, They are great on support.

#419262

Hi Nigel,

I got it working. It was a z-index that was messing around. I do wish to thank you for all your help with this project. Your patience and persistence proved I took the right option by buying Toolset. The support team was an invaluable part of the success of this project. I would NEVER have been able to pull this off without your help!

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