CGBlog URL without root_url

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
w00t
Forum Members
Forum Members
Posts: 14
Joined: Wed Jun 19, 2013 10:25 am

CGBlog URL without root_url

Post by w00t »

Hello.
Help me pls, how I can get CGBlog urls without root_url? Cuz output of the {$entry->detail_url} is http://192.168.0.101/2019/09/test.html, but I need only the second part of the url, without a website address or ip, I mean only "/2019/09/test".
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGBlog URL without root_url

Post by Rolf »

Dirty fix, but it will do the trick...

Code: Select all

{$entry->detail_url|replace:'http://192.168.0.101':''}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
w00t
Forum Members
Forum Members
Posts: 14
Joined: Wed Jun 19, 2013 10:25 am

Re: CGBlog URL without root_url

Post by w00t »

Thank yo so much for your try to help me Rolf, but unfortunately I realized that the problem seems to be not the case. No matter if I even clean up the link from root_url and place it to template everytime root url would be added to final link. Damn, I don't underdtand why... ???
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: CGBlog URL without root_url

Post by velden »

First question would be: why do you need it?

Second question: is the 'root_url' part really not removed from the link? (check the page's html source, NOT using user browser dev tools)

Further, you may check for the meta tag <base ...> in the head section of your template. Note that it comes by default using the {metadata} tag (https://docs.cmsmadesimple.org/tags/cms ... tadata-tag).
You can use a parameter to prevent the tag from being added automatically though you're then probably working around another problem.


I don't expect you actually will be hosting a blog using an internal ip address as the main 'domain'. So it may be better to configure your test environment to be more representative to production. For example adding a domain - ip address relation in your local hosts file.
Post Reply

Return to “Modules/Add-Ons”