• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Add meta Property to Head from Fabrik Element?

@sunnyjey you've reached a point where I can't help on a free, ad-hoc basis. If you'd like to talk to us about a direct support arrangement, with a "bucket" of hours each month you can draw on for support, let me know.

-- hugh
 
BTW, you can also use
Code:
$metaTags  = '<title>Your page title</title>';
$metaTags .= '<meta name="description" content="'.$DescrVar.'" />';
$metaTags .= '<meta name="author" content="Your name here" />';

$mydoc = JFactory::getDocument();
$mydoc->addCustomTag($metaTags);

Instead of using php_event list plugin, I used these codes into my custom template list & with the help of Jsitemap Pro I could finally succeeded in generating dynamic metaTags based on Filters.

BUT got another big problem.

$mydoc->addCustomTag('<link rel="canonical" href="www.mydomain/canonical/url" />');

When I am trying to get canonical url by using above syntax, I get my custom canonical url.

BUT, fabrik also adds another default canonical url at the top of my custom canonical url. It is generating two URLS
  1. www.mydomain/my-menu-url (<link rel="canonical" href="/my-menu-url" /> eg. if my menu name is say hotels-listing, fabrik adds www.mydomain.com/hotels-listing/)
  2. www.mydomain/canonical/url
I guess, Fabrik is forcing Default canonical url from this file

https://github.com/Fabrik/fabrik/blob/master/components/com_fabrik/views/list/view.html.php

Code:
* Set the canonical link - this is the definitive URL that Google et all, will use
     * to determine if duplicate URLs are the same content
     *
     * @throws Exception
     */
    public function setCanonicalLink()
    {
        if (!$this->app->isAdmin() && !$this->isMambot)
        {
            $url = $this->getCanonicalLink();

            // Set a flag so that the system plugin can clear out any other canonical links.
            $this->session->set('fabrik.clearCanonical', true);
            $this->doc->addCustomTag('<link rel="canonical" href="' . htmlspecialchars($url) . '" />');
        }
    }

How do I remove the default canonical URL. Is there any way I can remove $url = $this->getCanonicalLink(); ? Is layout override for /components/com_fabrik/views/list/view.html.php possible ?

Regards & Thanks

(NB: It looks Hugh is busy somewhere in his work, as he has not yet PM me)
 
Last edited:
It works for me: just a single canonical URL when using my code in my custom list template, no further action required. I don't know Jsitemap, perhaps it is involved here, too.

However, please do a count of both opening and closing brackets in your code line. Resulting action may help.

(NB: It looks Hugh is busy somewhere in his work, as he has not yet PM me)
Use this: https://fabrikar.com/quote-request
 
Thank you once again for your reply. I have spent many hours to address this issue.

If possible can you please share your code for canonical URL.
 
Just checked, can't find or recreate the exact code without spending more time on it, it's buried in some older backups.

But, as far as I remember, and as elsewhere in J!, in Fabrik lists you'll just need to get rid of the "original" canonical URL, then add the new one. Along the lines of: get head data, loop through the relevant section, empty the value where rel="canonical" is part of the string, set head data again, then add your own tag.
 
Yes, you are right. We need to unset the default canonical first. I have uninstalled JSitemap Pro.

Even tried following code to unset canonical in default.php of my custom list template:

Code:
$doc = JFactory::getDocument();
foreach ($doc->_links as $k => $array) {
if ($array['relation'] == 'canonical') {
unset($doc->_links[$k]);
}
}

But, it is not removing the www.mydomain.com/my-menu. It looks the unset for $this->getCanonicalLink(); is not working, like other MetaTags. If possible, please test it at your testing server to confirm this issue.

Once again Thank you for your help.
 
Sorry, I'm with Hugh / @cheesegrits here:

@sunnyjey you've reached a point where I can't help on a free, ad-hoc basis. If you'd like to talk to us about a direct support arrangement, with a "bucket" of hours each month you can draw on for support, let me know.

-- hugh

So I'd say more on this and my code to follow once you have some arrangement.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top