CB autoaction route triggers

1 year 5 months ago #331624 by krileon
Replied by krileon on topic CB autoaction route triggers

BTW did you change urls with CB 6 ?
You wrote &action=ACTION_HERE&func=FUNC_HERE&id=ID but on my install it's &action=ACTION_HERE&id=ID ??

Nope, function has always existed. It just isn't used for default "show" view. If function doesn't exist when rewriting the URLs you might want to add it as a segment falling back to "show". SEO of CB Activity URLs will of course be handled in CB Activity 6.0.0 by default though.

Another question, will the Activity object be built correctly in this code during the routing ? or is there any other order to respect between  joomla and CB ?

The namespace looks right so yeah that'll probably work to construct an activity object. That won't reverse though. Remember you have to reverse this. So if you've something like "blablabla-activity_id" you need to reverse that into id = activity_id. So be careful with how you're trying to format all this and consider if again it's even necessary.

CB Redirect Bot could translate that into a CB activity URL and redirect them to it. Then when you give someone that URL you just give it to them in whatever format you want. Example as follows.

URL: /group-events/activity_id-my-custom-alias

CB Redirect Bot
From URL:
%/group-events/(\d+)-[^/]*%i
To URL:
/index.php?option=com_comprofiler&view=pluginclass&plugin=cbactivity&action=activity&func=show&id=$1
Is REGEXP: (checked)

Now when someone tries to go to /group-events/1234-myactivity it will sent them to the activity display. You've options other than trying to implement custom routing as like I said custom routing is complicated. Joomla has a lot of oddities about it that can cause routes to conflict and if they fail to reverse at any point then you'll never reach your destination.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

1 year 5 months ago #331628 by activha
Replied by activha on topic CB autoaction route triggers
yes I perfectly understand your point concerning CB Redirect Bot and it would be much easier to use.

But what I really need in fact is a good SEO for the urls. I need to build URLs for our special activities like website/company/name-of-company-activity_id

I could surely do it with an autoaction and have it displayed on the activities page to be shared, and then dealt with by CB Redirect Bot

But I guess that in this case CB Redirect Bot would provide a 301 redirection to website/activation/id which will be the url stored by the search engine. Which is exactly what I want to avoid.

Am I correct on this ?

Please Log in to join the conversation.

1 year 5 months ago #331632 by krileon
Replied by krileon on topic CB autoaction route triggers

But what I really need in fact is a good SEO for the urls. I need to build URLs for our special activities like website/company/name-of-company-activity_id

You can do that. There's nothing stopping you from doing that with the CB Redirect Bot usage. You can give them literally whatever URL you want as long as you can extract activity_id from it. So when you display the URL to them by whatever means you're currently doing so format it however you like as long as it has an activity_id you can extract.

But I guess that in this case CB Redirect Bot would provide a 301 redirection to website/activation/id which will be the url stored by the search engine. Which is exactly what I want to avoid.

The search engine will store the URL you provide to the user when it crawls the page. Pretty URLs are basically irrelevant to SEO anymore. All that matters is strong metadata. Primarily JSON-LD structured data. So for example if you insert JSON-LD structured data on your pages then it quite literally does not matter what the URL is or ever will be as search engines will exclusively use that structured data for SEO.

Additionally CB Redirect Bot lets you set the response code. You can have it respond with a 200 OK instead of a 301 Moved Permanently.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

1 year 5 months ago - 1 year 5 months ago #331633 by activha
Replied by activha on topic CB autoaction route triggers
ahhhh very very interesting :-)
Will look deeper into it as it would be much easier to implement.
Thanks a lot for your advices (as usual ;-) )

PS :  regarding json-ld do you know a joomla plugin which integrates it or is it better to work with an external library integrated in my pages ? could you recommend something ?
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

1 year 5 months ago #331654 by activha
Replied by activha on topic CB autoaction route triggers
Well after a day of analysis, I don't think the CB Redirect Bot option will work because we need to link to a single activity from the timeline and only then share the url. So the single activity page url would always be the target of the redirect bot and not the built url entered by the autoaction in the flow.

I got your point on SEO but we also need from a marketing and commercial point of view to show a pretty url with the display of the title :-)

So I don't really see another solution than routing and parsing except if you have an idea to keep the same links from the flow page to a single activity page (see activ-ha.com/flow for instance and activ-ha.com/activation?id=6470 for a single activity display)

It seems that my code works fine for routing but I do have an issue with parsing.

Is the bug that you fixed already included in the nightly build ?
and finally for action and func, what will be the options of CB 6.0 to include in different cases in the code ?

Please Log in to join the conversation.

1 year 5 months ago #331656 by krileon
Replied by krileon on topic CB autoaction route triggers

Well after a day of analysis, I don't think the CB Redirect Bot option will work because we need to link to a single activity from the timeline and only then share the url. So the single activity page url would always be the target of the redirect bot and not the built url entered by the autoaction in the flow.

Don't understand what you mean by this. When you generate the URL to give to the user give it to them already formatted how you want. Then setup CB Redirect Bot to handle it. Or do you mean they're just copying the URL from browser address bar to share?

Is the bug that you fixed already included in the nightly build ?

The fix is not available yet, but will be either today or more likely tomorrow.

and finally for action and func, what will be the options of CB 6.0 to include in different cases in the code ?

The current URL behavior isn't really changing in CB Activity 6.0.0 beyond having SEO URLs built in with internal routing behavior just like GJ. 99% of CB Activity URLs are never user visible as they're used via fetch requests. So you really only need to SEO direct activity URLs (&action=activity&func=show&id=ACTIVITY_ID).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.198 seconds

Facebook Twitter LinkedIn