Flexifilter Module to show values as unordered list

More
9 years 3 months ago #57201 by smarterweb
We would like to show values of certain filters as an unordered list with hyperlinks in a module. This would be quite useful for a couple of different scenarios where you only want to show values that can be clicked on. So far, I have made an override of the mod_flexifilter default.php file and managed to turn a dropdown list into a plain unordered list with the following code within my override:

$js .= '
jQuery(document).ready(function() {
var $moduleFCform_132_27_val = jQuery("#moduleFCform_132_27_val");
$moduleFCform_132_27_val.find("option").map(function() {
var $this = jQuery(this);
return jQuery("<li>").attr("value", $this.attr("value")).text($this.text()).get();
}).appendTo(jQuery("<ul>").attr({
id: $moduleFCform_132_27_val.attr("id"),
name: $moduleFCform_132_27_val.attr("name")
})).parent().replaceAll($moduleFCform_132_27_val);
});
';
$document->addScriptDeclaration($js);

However, I struggle to turn the values into hyperlinks that would lead to the respective filter view (same as if you would select a filter value and then hit the "GO" button.
Is there anyone that could help with this or maybe even add that functionality to the flexifilter module?

Any help much appreciated!
Attachments:

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #57203 by ggppdk
Hello

we have various displays for filter display mode,
recently added filter display modes:
- slider
- slider range

so you suggest 1 more:
- links ?

- enabling autosubmit and displaying as radio
- and then using CSS to
a. hide the radio boxes
b. color the radio labels appropiates
c. applying other CSS to it

will it not give a similar result,
what is the advantage -and- usefulness of this ?
e.g. better SEO (google indexing ?)
other ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #57225 by smarterweb
Hello,
I know there are all these different ways to display filters, but we would like to make a dropdown select (in backend) and display the values as links in FE. This would allow to create dynamic menus, or in our case display categories (in this case filter values) in a module position as a plain list with hyperlinks. Then that list will only ever populate with values that are actually available (like only show links to filter values that are used in an article.

If it's hard to do, forget about it - just thought it might be a good idea...

How can I support your project? You have done outstanding work with FC and I have been working with many other CCKs over the last year, but nothing comes even close to Flexicontent. This is by far the best CCK we have ever seen for Joomla.

Thanks

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #57226 by ggppdk
Hello

actually this can be easy (maybe), as all fields use a helper function that creates filter HTML
flexicontent_fields::createFilter()

(if you make a custom field type, you can choose not to call this function)


but the question is not to add something very uncommon

- using filtering module to create menu-like links, sounds good idea

--> now you can create category menu items with locked filters to have a similar effect,
but you have to create these manually

but i see the usefulness of what you suggest



- each filter value will be a link link to form's target , + , a URL variable: &filter_45=value
- but we will also need javascript to add other active filters (filter form may have other filters too)

possibly this can be done by adding to the onclick event of the URLs this:
Code:
this.form.action=this.href; // Set the form action to the URL that was clicked that also has current filter value adminFormPrepare(this.form, 2); // Then add values of various other filters and submit the form return false; // Prevent URL that was clicked from being followed

The above code will allow to have URLs, but will make them not followable
- thus we will have links indexable by search engines for a field F
- but also filter form will be able to be submited including values of other filters besides the field F


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
9 years 3 months ago #57228 by ggppdk
If you have some suggestion, to the above thoughts, please comment
i spoke of the usefulness of making the filter be links:

- easier styling to look like menu
- indexing by search engines

Here an enhancement issue with milestone v3.0.x (that is not v3.0.9)
github.com/FLEXIcontent/flexicontent-cck/issues/291


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.388 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline