Finally a working sh404SEF plugin for Fabrik

jfquestiaux

Well-Known Member
It took me quite a while, but eventually I got it working!

You can now enjoy the features of sh404SEF with Fabrik.

Here is how it works :


  1. While it is not part of the Fabrik download on GitHub, upload the attached file into components > com_fabrik > sef_ext and override the included file.
  2. Then do the following settings (required for it to work) :
    1. For each of your lists, you have to set a "SEF slug" : in the "navigation" tab of your list's settings, choose one element that will be used in the SEF URL
    2. Optional but important : there is a great new feature in Fabrik 3 that allows you to have different display (columns and/or prefilter) to the same list without having multiple copies of that list : you just have to set the desired options in the link menu settings. Although this is very convenient, it has the drawback that in that case, the name of the list being always the same, the SEF URL for your different links will all be the same and therefore they will all point to the first list in the menu order. To avoid that, you have to set the "Prepend menu title" to "Yes" in the SEF tab of the Fabrik options. In this case, the SEF URL will show the title of the link instead of the label of the list and all the different views will be linked correctly.
    3. Optional : if you want to include the list's name in the URL when you link to a detail view, go the "SEF" tab in the Fabrik options and set "Table name on forms" to "yes".
    4. In sh404SEF configuration, in the "By component" tab, make sure you have "use default handler" for fabrik.
    5. On the same line, set "enable shURL" if you want to create short urls for your Fabrik pages
    6. If you have changed the settings in sh404SEF, you should purge the already created URLs
The SEF URL work this way :

  • Link to a list : you have the label of the list in the URL
  • Link to detail : you have the chosen slug, preceded by the list name if set so, in the URL
  • Link to visualization : you have the label of the visualization in the URL
  • Edit or create a record : no SEF is created - you can always create one manually in sh404SEF for specific forms if needed (like for a contact form)
Important note : if you want to make a link to a detailed view of a specific record in a list, you have to add an option in the fabrik options menu (as long as Rob has not added this feature). Check this post on how to do it.


Kwown issue : when you have a menu link pointing to a detailed view record, the URL is correct but for some reason the active menu is set to the existing menu item of the list that contains the record.
It can be a problem if these links are submenus that suppose to stay invisible when they are not active. I hope I'll find a solution.


You can see the plugin in action on my site.

EDIT : as of March 24th, I uploaded a new version to correct a few issues. If you have already downloaded the previous version, you should replace the file by this one. Be sute to have the 1.2 version (check in the top of the file).
 

Attachments

  • com_fabrik.php.zip
    2.1 KB · Views: 607
hi - should / could I add this as a replacement to the current sef_ext file in our code?
 
Hello Rob,
Please do. The current one was designed for Fabrik 2 and does not work at all with fabrik 3 (gives a fatal error).
I can't garantee of course it will work in every J! install on every server configuration but it is working on a rather common config :
Joomla! 2.5.3 - Fabrik 3.0.4 + GitHub 179 - sh404SEF 3.4.6.1269 - 5.3.3-7+squeeze8 - Linux Debian 6

If someone encounter some problem, I will try to fix them, in the limits of my capacities. I will also send you new versions if I update this file.
 
Is there any way you can use git / github for this?

It makes it ten times easier for us to keep up with your code changes if you use a branch of the main Fabrik github project, as we can then merge your updates with one mouse click.

Check out this help page:

http://help.github.com/fork-a-repo/

... specifically, sending pull requests from your fork.

-- hugh
 
I understand. I think I have to overcome my psychological block regarding GitHub and get on to it.
I gave it a go a while ago and created a fork. Now that I have the explanations on the Wiki, I want to start afresh but last time I looked I did not find a way to delete my existing fork. I guess I'll have to try again.
 
error

Good Day

I get this error on the lates update from github

Fatal error: Call to a member function setId() on a non-object in C:\xampp\htdocs\art\components\com_fabrik\sef_ext\com_fabrik.php on line 71

thanx
 
You have this error because the sef plugin included in the Fabrik version is an old version (actually for Fabrik 2) that does not work with Fabrik 3.
I have not yet had the time to find out how to upload files to GitHub, so in the meantime, you can download the file included int the first post of this thread and replace the existing fabrik file by this one.
It is working on mys site, however I can't garantee it will work in every environment.
 
filter reset

Good Day

I have latest code from github and sh404sef plugin.

The problem is when I use the filter function it shows the results, but when I click on next on pagination the filter reset back to all, it works without sh404sef plugin and with normal joomla sef, this is what I see with normal joomla sef,
?lang=en&resetfilters=0&limitstart15=10

The resetfilters=0 is not applied in the sh404sef plugin (I think)

thanx
 
You don't have to bumb your thread everyday. We attend to your issues when we can...

Anyway, I could not reproduce your issue. I made a sceencast so you can see whether I tested the same way you did http://screencast.com/t/3F4bQ4efH : I have a list with about 10 records - I filter on one data, then on another and each time the filter stays applied going from one page to the other.

Here are my settings for the test :

  • Joomla 2.5.6
  • Fabrik 3 + GitHub 674 (version as of yesterday)
  • Latest sh404SEF release (3.5.1.1299)
  • URL rewriting using mod_rewrite (with .htaccess - this is the default Joomla htaccess)
  • Joomla SEF turned OFF
  • For the list in Fabrik, a slug is chosen (required so the SEF plugin work properly), but it is not the element with the filter
  • In the Fabrik options , "Prefix menu option" and "Table name in form" are both set to "Yes" (although I don't think this has an influence in this case, but I just xwanted to be complete).
  • The settings of my server are in my signature
 
reset filter

Good Day

Thank you for getting back to me.

I have done everything you have said to the letter, but nothing worked correctly, but then I opend the menu item and I select "reset filters" to no, went back to test it and it worked perfectly and when I set the reset filters back to yes the filter pagnitation did not worked.

The "reset filters" in the menu item has to be set to yes, anyway of how to fix this.

thank you for your patience.
 
The only solution I found is to comment out the line 219 so it looks like this :
Code:
// shRemoveFromGETVarsList('resetfilters');

Now, the filters are reset when you click from your link, then when you set up a filter, it stays on when you go from one page to the other.
 
I have a new install of Fabrik 3.0.6 with latest github tonight.
Fresh install of Joomla 2.5.6
PHP 5.3.14
Latest update for sh404SEF 3.5.1.1299

Joomla Global Config[SEO Settings]
Search Engine Friendly URLS - Yes
Use URL rewriting - Yes
Adds suffix to URL - No

I have renamed my htaccess.txt file to .htaccess

in sh404SEF Start tab:
Enable URL Optimization - Yes
Enable remote configuration - Yes
Rewriting mode - with .htaccess 9mod rewrite)
Active security functions - Yes

My issue is I have 7 Fabrik Form pages on my site that are not creating SEF URLS's.

Which is every sub menu under this Main Menu:
http://racersurance.com/Insurance-Plans

Also the contact us page is a fabrik form:
http://racersurance.com/index.php?option=com_fabrik&Itemid=144&formid=8&lang=en&view=form

Anyhow I followed your instruction with the the 6 settings you recommended.
Set my SEF Slug for each list to element ID
In Fabrike Options I set the SEF Tab options to Yes
in sh404SEF by component I have use default handler for fabrik
I set enable shURL
I purged the urls.

Any advice on what I am doing wrong? Thanks in advance.

Brandon
 
I gather that the issue concerns only url to forms that add new records (not to detailed view).

If so, this is the intended behavior : no SEF url is created when you create a new record (I guess I was having issues with this).

But that does not mean you can't have one. You just need to add a custom one.
For instance, for your contact form, the url is http://racersurance.com/index.php?option=com_fabrik&Itemid=144&formid=8&lang=en&view=form

Go to Component>sh404SEF>URL - click on "New" to create a new entry - In the "URL non-SEF" field, enter the URL of the contact form (index.php?option=com_fabrik&Itemid=144&formid=8&lang=en&view=form - don't copy the domain name) and in the "SEF URL" field, enter the desired name for the link (has to be unique).
While you are there, you may add a custom title/description for that url.
 
I gather that the issue concerns only url to forms that add new records (not to detailed view).

If so, this is the intended behavior : no SEF url is created when you create a new record (I guess I was having issues with this).

But that does not mean you can't have one. You just need to add a custom one.
For instance, for your contact form, the url is http://racersurance.com/index.php?option=com_fabrik&Itemid=144&formid=8&lang=en&view=form

Go to Component>sh404SEF>URL - click on "New" to create a new entry - In the "URL non-SEF" field, enter the URL of the contact form (index.php?option=com_fabrik&Itemid=144&formid=8&lang=en&view=form - don't copy the domain name) and in the "SEF URL" field, enter the desired name for the link (has to be unique).
While you are there, you may add a custom title/description for that url.


That's what I was thinking but just didn't know if I did something wrong. Thanks for the response.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top