Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Search Result] Change the default URL generation #108

Open
thiagarajanm opened this issue Mar 20, 2021 · 5 comments
Open

[Search Result] Change the default URL generation #108

thiagarajanm opened this issue Mar 20, 2021 · 5 comments

Comments

@thiagarajanm
Copy link

How to change the default URL which is generated in the search result?
I have /category/blog-post. I have the blog category in the url as a dynamic field.

The search result brings up /default or /post.

Could you help me with the change to get the category in the url?

@tobias-kuendig
Copy link
Member

Blog post in what plugin?

You can read here how to generate a page url if it is a custom plugin:
https://octobertricks.com/tricks/generate-link-cms-page

@thiagarajanm
Copy link
Author

Its not a custom plugin. Its the rainlab.blog and rainlab.pages plugins.

@tobias-kuendig
Copy link
Member

Did you set the correct rainlab_blog_page in SiteSearch's backend settings?

It should generate the link here:

$result->url = $post->setUrl(Settings::get('rainlab_blog_page', ''), $this->controller);

by calling RainLab's setUrl method:
https://github.com/rainlab/blog-plugin/blob/master/models/Post.php#L157

That should help you debug the issue.

@thiagarajanm
Copy link
Author

@tobias-kuendig yes the backend settings are set correctly. But this only generated the default url set by october not the actual url used in the blog post page.

@tobias-kuendig
Copy link
Member

I'm not sure what you mean. Can you post the page header of the cms page that hosts the blog component?

What URL is generated and what URL do you expect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants