VirtueMart Forum

VirtueMart 2 + 3 => Templating & Layouts => Topic started by: 2cool on March 30, 2021, 09:10:15 am

Title: create page based on filtering url
Post by: 2cool on March 30, 2021, 09:10:15 am
Hi, in using a filters plugin which shows products based on this filters.
I can open a filtered page from this generated url but I would like to create a separate page (category) with a title and description + the filtered products.
Does anyone how this can be done? maybe use a template override? Not sure how to modify such category page.

Working with Joomla! 3.9.25 + VirtueMart 3.8.8

Thanks,
Pas
Title: Re: create page based on filtering url
Post by: Jörgen on March 30, 2021, 11:40:32 am
Defining the landingpage for the filterextension. Maybe ? Same principle as defining a category for the VM extension.

Jörgen @ Kreativ Fotografi
Title: Re: create page based on filtering url
Post by: 2cool on March 30, 2021, 14:13:47 pm
Sorry Jörgen,
I don't understand what you mean? can you explain?

right now I have a 'filter url' like //seachresults/?custom_f_31[0]=313435
Would like to have this with title and description in a menu (maybe with a logic url;)

Thanks,
Pas
Title: Re: create page based on filtering url
Post by: pinochico on March 30, 2021, 14:39:36 pm
Yes, of course

We use CF4All too.

Look at this: https://www.kolo-park.cz
On right side in slideshow are links for result after filtering products from shop.

Example:
https://www.kolo-park.cz/obchod/prislusenstvi-1/nejnovejsi

This URL you can add to menu, but need define in httacess:
RewriteRule ^obchod/prislusenstvi-1/nejnovejsi https://www.kolo-park.cz/obchod/prislusenstvi-1/radit_podle,datum_vytvoreni?keyword= [L,R=301]

So for you you have to change to

seachresults/?custom_f_31[0]=313435

Title: Re: create page based on filtering url
Post by: balai on March 30, 2021, 14:41:39 pm
You need to copy the url and create a menu item of type System Links > URL, with that url as destination.

Is the title and description refers to meta tags or actual/visible elements?

In any case Custom Filters uses the category layout for displaying the results.
If you are using a template with normal template overrides, the category layout file is located in: templates/YOUR TEMPLATE/html/com_virtumart/category/default.php
You should edit that file and either change the meta-tags or add the visual elements you want.
Title: Re: create page based on filtering url
Post by: 2cool on March 30, 2021, 15:13:42 pm
Thanks,
Indeed add link to menu as sytem link is working but
I want to add a title and description like any vm category page to this.

So guess use a template override should be possible, but i'm not sure if I should modify the template(templates/YOUR TEMPLATE/html/com_virtumart/category/default.php)
or can I set this in template override setting in vm backend?

Regards,
Pas
Title: Re: create page based on filtering url
Post by: balai on March 30, 2021, 16:53:45 pm
Quote
So guess use a template override should be possible, but i'm not sure if I should modify the template(templates/YOUR TEMPLATE/html/com_virtumart/category/default.php)
or can I set this in template override setting in vm backend?

This is not related with the VM backend which btw recognizes and uses the template overrides.
You need to edit the layout and put conditional title/description based on a page or whatever you want.
Title: Re: create page based on filtering url
Post by: pinochico on March 30, 2021, 18:40:42 pm
For this we use in www.kolo-park.cz own modul

virtuemart_category_header with two template:
- title of category
- title and description of category

Look at this (Search result from Customfield Search from Breakdesign):
https://www.kolo-park.cz/obchod/kola-a-elektrokola/radit_podle,datum_vytvoreni?keyword=

The modul is putted in position above outside category / search result view in override template.

But if you need add cusotm title and description:
- title you can put from menu item
- description you can add in override template as condition
Title: Re: create page based on filtering url
Post by: 2cool on March 31, 2021, 10:43:10 am
Yes, this is exactly what I want. Nice site also!
How can this be done? I have only a view so can I create separate templates and modify each in code?

Regards,
Pas
Title: Re: create page based on filtering url
Post by: balai on March 31, 2021, 12:10:22 pm
Quote
Yes, this is exactly what I want. Nice site also!
In terms of title display, the mentioned site shows the current category name.
This already happens in Custom Filters without any customization.

It also shows the selections as tags/breadcrumbs which can be done through the included CF tags/breadcrumbs module.
Title: Re: create page based on filtering url
Post by: 2cool on April 06, 2021, 09:32:08 am
Hi,
I really don't know what you say Balai?
I have filter for colors; if I use the url of this filter option I have no title or description?
So my idea was to use a template overrride and change the template php page thatss used for display filter results and add title and description.
But i'm not sure if possible and how this should be done.

 
Title: Re: create page based on filtering url
Post by: pinochico on April 06, 2021, 10:28:37 am
I don't understand

The basic info from Custom Filters (balai) in documentation is:
- create new menu item as type Custom Filter Search Result

From this menu you have title without description and every filter results are connected with this menu (not with category shop), of course with similiar view.

But in our shop (www.kolo-park.cz) we don't show this menu item title, then we need custom title and custom description too.

Then we created custom modul == VM category header, with option:
- show only category title from active category
- show category title and category description from active category

The main advantage from this module is, then module is outside from VM category view == above the view with filtering module....


Maybe balai have other info then me?
Title: Re: create page based on filtering url
Post by: marvays on April 06, 2021, 11:56:27 am
Hi, in using a filters plugin which shows products based on this filters.
I can open a filtered page from this generated url but I would like to create a separate page (category) with a title and description + the filtered products.
Does anyone how this can be done? maybe use a template override? Not sure how to modify such category page.

Working with Joomla! 3.9.25 + VirtueMart 3.8.8

Thanks,
Pas

Hi. I've been working on this for months. And I have no result.
What I've found so far:
I use JoomSEF where I can set up my own 301 redirects. So I create a filter, copy the url and create 301 on a nice sef url
I can set TITLE, Meta Description and much more for this sef url.

Now I'm working on replacing the H1 category name and category description directly on the page with my own h1 name and another description.

I would like to make the H1 name by inserting my own meta tag into the sef url and displaying it instead of the h1 category title. Using the module or articles, I will proceed in the same way to describe the category.
To be able to replace in the code, I will use extensions from Regularlabs.

That's just a theory. I haven't tried it in practice yet, because I don't have a Regularlabs subscription and I can't try it in the free version because they have limitations.

If you have access to Regularlabs, we can join forces and work on it together.
Title: Re: create page based on filtering url
Post by: pinochico on April 06, 2021, 12:04:55 pm
But I keep my fingers crossed :D
Title: Re: create page based on filtering url
Post by: balai on April 06, 2021, 12:16:06 pm

Then we created custom modul == VM category header, with option:
- show only category title from active category
- show category title and category description from active category

The main advantage from this module is, then module is outside from VM category view == above the view with filtering module....
Maybe balai have other info then me?

As wrote in my message, what you describe happens without the need for any modification. This is a core feature in Custom Filters.
Beyond that it also updates the meta tags from the active category.
But if anyone wants to print other data, will need coding to the category layout.
Title: Re: create page based on filtering url
Post by: pinochico on April 06, 2021, 12:35:59 pm
Quote
If you have access to Regularlabs, we can join forces and work on it together.

Why do I have to feel that the Czechs are a nation that always pisses everything off, just to gain an advantage.
I'm not like that and I really appreciate Peter for what he does for Joomla. By the way, in my opinion, he belongs to the top who produces excellent products and I would have to be ashamed if I tried not to pay him for a license, because I know that selling licenses never, really never pays for the entire application development and tried to ask someone completely foreign if they would he did not disclose the license to me.

But as I wrote, I keep my fingers crossed, even though I think mine.
Title: Re: create page based on filtering url
Post by: 2cool on April 07, 2021, 12:17:58 pm
Hmmm still not sure how this should work.

I have a filter (customfieldsforall) called color with options like; white, black, etc.
How can I create custom pages for each color?
As I can see while hovering over the filter options each color has it's own url.
But I can't figure out how to create this into seperat pages with title and description.

Thanks,
Pas
Title: Re: create page based on filtering url
Post by: pinochico on April 07, 2021, 12:34:55 pm
send your website link, I check
Title: Re: create page based on filtering url
Post by: 2cool on April 07, 2021, 14:25:31 pm
I have the site local.
But it's the same as https://demo.breakdesigns.net/apparel/t-shirts/men-s-sport-t-shirt-detail
With url's like in color filter.
Blue showing url: https://demo.breakdesigns.net/results/t-shirts/?custom_f_4[0]=313737

Hope you can explain how to create this.

Regards,
Pas
 
Title: Re: create page based on filtering url
Post by: pinochico on April 07, 2021, 14:50:27 pm
great, i like talk about example

So, this URL == https://demo.breakdesigns.net/results/t-shirts/?custom_f_4[0]=313737
You can put inside httacess and create your custom redirect == etc: https://demo.breakdesigns.net/results/t-shirts/blue

So, the title is from category name == T-Shirt - OK
Description (now not viible) will be too from category T-Shirt Description - you have to change in view for CF result or in category setup or CF setup

Is this solutions what do you need or other? :)

Title: Re: create page based on filtering url
Post by: 2cool on April 07, 2021, 19:09:56 pm
Yes, now I know this should work, Thanks!

So I create a new item in joomla menu 'blue' selecting virtuemart category view.
In vm I also create a category 'blue' with title and description
In htaccess I use: Redirect /results/?custom_f_31[0]=313435 /colors/blue

And also the same for other colors.
Since I work local would this redirect also work? before I go nuts ;)

Regards,
Pas

Title: Re: create page based on filtering url
Post by: pinochico on April 07, 2021, 21:21:38 pm
completely wrong :)

ok, I interrupt watching Champions League and try self
Title: Re: create page based on filtering url
Post by: pinochico on April 08, 2021, 00:44:34 am
1. Where do you want use filter for color? == in which category?
2. You don't need create menu item - only if you want change title
3. You don't need create VM category - definitelly
4. You need only httacess

I have these:

#links to category
RewriteRule ^obchod/kola-a-elektrokola/nejnovejsi https://www.kolo-park.cz/obchod/kola-a-elektrokola/radit_podle,datum_vytvoreni?keyword= [L,R=301]
RewriteRule ^obchod/kola-a-elektrokola/elektrokola/nejnovejsi https://www.kolo-park.cz/obchod/kola-a-elektrokola/elektrokola/radit_podle,datum_vytvoreni?keyword= [L,R=301]
RewriteRule ^obchod/komponenty/nejnovejsi https://www.kolo-park.cz/obchod/komponenty/radit_podle,datum_vytvoreni?keyword= [L,R=301]
RewriteRule ^obchod/prislusenstvi-1/nejnovejsi https://www.kolo-park.cz/obchod/prislusenstvi-1/radit_podle,datum_vytvoreni?keyword= [L,R=301]
RewriteRule ^obchod/obleceni-1/nejnovejsi https://www.kolo-park.cz/obchod/obleceni-1/radit_podle,datum_vytvoreni?keyword= [L,R=301]
RewriteRule ^obchod/vsechny-produkty/nejnovejsi https://www.kolo-park.cz/obchod/radit_podle,datum_vytvoreni?keyword= [L,R=301]

You have to do it filter and result URL you have to put inside httacess.
Description and title is from category, which you filtering - this is basic function CF

Example:

https://demo.breakdesigns.net/results/t-shirts/?custom_f_4[0]=313736

Then you see - title is from category T-shirt, isn't it?
if you want description too - got to override view and add or go to setup CF filtering and setup - I don't know where is right option.
(or you can create or use own module VM Category header for showing information outside template view)

If you need this URL:

https://demo.breakdesigns.net/results/t-shirts/red

then put inside httacess
and of course you can create menu as custom URL: https://demo.breakdesigns.net/results/t-shirts/red

If you klik on this link, then you see - URL changed to https://demo.breakdesigns.net/results/t-shirts/?custom_f_4[0]=313736 and you see right result.
Title: Re: create page based on filtering url
Post by: 2cool on April 08, 2021, 13:51:59 pm
Hope you had a good time watching PSG ;)

1. Where do you want use filter for color? == in which category? filter options will be almost on all pages (works fine with many other filter options)
2. You don't need create menu item - only if you want change title - I want to create separate pages for each filter color and add title and description for better seo.
So I can create a custom title from a new menu, and description from category? should I create new joomla or virtuemart category? I would like a description for each color (red, white, etc)


3. You don't need create VM category - definitelly - check ;)
4. You need only httacess - check ;) this is indeed different from what I suggested.

Hope this makes sense...

Thanks and regards,
Pas
Title: Re: create page based on filtering url
Post by: pinochico on April 08, 2021, 14:10:39 pm
Oh yes, if you filtering basic VM category (ID=0) and you need custom description for every type of filters, I understand - that is problem

You need workaround:
- for every filter result you need create menu item type System / URL and setup title
- for every menu item you need fill meta description and this meta description you need load in CF Result page view - little custom php work

Menu items you can setup as submenu for menu Search result with alias as name of filter == then URL will be www.shop/result/red

But this url not exist (only virtueal), because in setup menu item you put URL with "?name-of-customfield" and maybe you have to add this URL in httacess to redirect (as I wrote) - you have to check and test.
Title: Re: create page based on filtering url
Post by: 2cool on April 08, 2021, 16:17:05 pm
Thanks,

I'll try this setup as you described and let you know.
While testing local would this be a problem with the redirects?
- for every menu item you need fill meta description and this meta description you need load in CF Result page view - little custom php work - how and where should this be done?

Regards,
Pas
Title: Re: create page based on filtering url
Post by: pinochico on April 08, 2021, 17:51:32 pm
> for every menu item you need fill meta description and this meta description you need load in CF Result page view - little custom php work - how and where should this be done?

yep, custom developing in PHP, but sorry I never send PHP custom develop in any forum,

you have to
- wait if other send you as free
- hire some PHP developer