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

SITEURL vs e_BASE and e_HTTP #3473

Closed
Jimmi08 opened this Issue Sep 28, 2018 · 21 comments

Comments

4 participants
@Jimmi08
Contributor

Jimmi08 commented Sep 28, 2018

How to get full path in database field?

There is only available shortcode version for e_BASE: {e_BASE}
e_BASE is not defined (or empty) in browser debugger output

SITEURL has correct value, but it can't be used in shortcode version {SITEURL}
e_HTTP (what should be replace for e_BASE) doesn't have shortcode version too.

I am trying to get full path in menu button url.

Thanks

@rica-carv

This comment has been minimized.

Contributor

rica-carv commented Sep 28, 2018

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Sep 28, 2018

image

@Jimmi08 Jimmi08 changed the title from SITEURL vs e_BASE and e_HTML to SITEURL vs e_BASE and e_HTTP Sep 28, 2018

@rica-carv

This comment has been minimized.

Contributor

rica-carv commented Sep 29, 2018

And SITEURLBASE???

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Sep 29, 2018

Do you see it between available shortcodes?

				'{e_MEDIA_FILE}',
				'{e_MEDIA_VIDEO}',
				'{e_MEDIA_IMAGE}',
				'{e_MEDIA_ICON}',
				'{e_AVATAR}',
				'{e_WEB_JS}',
				'{e_WEB_CSS}',
				'{e_WEB_IMAGE}',
		//		'{e_WEB_PACK}',
				"{e_IMAGE_ABS}",
				"{e_THEME_ABS}",
				"{e_IMAGE}",
				"{e_PLUGIN}",
				"{e_FILE}",
				"{e_THEME}",
				//,"{e_DOWNLOAD}"
				"{e_HANDLER}",
				"{e_MEDIA}",
				"{e_WEB}",
				"{THEME}",
				"{THEME_ABS}",
				"{e_ADMIN}",
				"{e_BASE}",
				"{e_CORE}",
				"{e_SYSTEM}",
@rica-carv

This comment has been minimized.

Contributor

rica-carv commented Sep 29, 2018

If it's not in core shortcodes, what prevents you of making it globally available via plugin shortcode (e_shortcode.php) or via theme shortcodes?

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Sep 29, 2018

@Jimmi08 I can fix things, if I understand what is correct way and what is not.

e_BASE should not be used, but shortcode {e_BASE} is still there. And e_HTTP is new, but shortcode e_HTTP is missing. Or maybe SITEURL should be added. With SEF-URL there should be shortcode to full site url.

I need answer from core developers, not to find next workaround.

@rica-carv

This comment has been minimized.

Contributor

rica-carv commented Sep 30, 2018

@Jimmi08 I know that workaround is not the ideial solution, but if developers don't give a reply, you'll need a backup solution, no? I do that a lot on my plugins and theme.... If you can't hunt with a dog....

Anyway, can't the e_BASE shortcode be there for legacy purposes, maybe? I can't figure out why make a shortcode for a empty return, indeed....

Furthermore, instead of making a single shortcode to output every single constant, what's the issue on using the constant instead of the shortcode?
Or make a single shortcode, to output the constant needed, like e_CONSTANT: const=e_BASE

Just my two cents...

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Sep 30, 2018

@rica-carv
try to put full path to news into menu button url and display. With sef-urls you need to full path and my question was how to do it. I have already fixed this but inserting full path (hardcoded). If you can use {e_ADMIN) and so, maybe there is way how to get siteurl (mainpage).

{SITEURL} shortocode already exists, you can use it with templating. But if you put it in field, replace constant is used, not parse template.
Maybe there is other problem, why is not replaced in template...

But something is there wrong. So if I get answer what is correct, I can test if it works or not. I don't need to workaround for this.

Developers will not answer in issue with so long discussion...

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Sep 30, 2018

@Jimmi08

I am trying to get full path in menu button url.

Did you try using / ?

@CaMer0n CaMer0n added the question label Sep 30, 2018

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Sep 30, 2018

@CaMer0n
/news - didn't worked
image
news - worked on homepage
but not with sef-url:
image
image

So what constant has now site path (like siteurl) and can be used as field value?

@CaMer0n CaMer0n added the bug label Oct 2, 2018

@CaMer0n CaMer0n added this to the e107 2.2.0 milestone Oct 2, 2018

@CaMer0n CaMer0n closed this in a78b44f Oct 2, 2018

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Oct 2, 2018

@Jimmi08 This should fix it, but please re-open if necessary. Just use {e_BASE}news for your value.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Oct 2, 2018

You are quicker than my test. I just test it before commit. But on line 298 is the same code.

CaMer0n added a commit that referenced this issue Oct 2, 2018

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Oct 2, 2018

@Jimmi08 Thanks. Fixed it.

@Moc Maybe for the docs?

replaceConstants($value) = file path (not for URLs)
replaceConstants($value, 'abs') = absolute URL. 
replaceConstants($value, 'full') = full URL. 
@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Oct 2, 2018

@Moc what is different between abs and full?

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Oct 2, 2018

@Jimmi08

(default) = news
abs = /news
full = https://domain.com/news
@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Oct 2, 2018

This was confusing :) First example is in fact relative url. And I thought abs means absolute, so full. So I asked. Nevermind.
Full is correct option or abs only with {e_BASE}.
Thank you. This is big improvement.

@Moc Moc added this to Backlog in Documentation update via automation Oct 2, 2018

@Moc

This comment has been minimized.

Member

Moc commented Oct 2, 2018

Will add to documentation (on backlog for now)

@CaMer0n

This comment has been minimized.

Member

CaMer0n commented Oct 2, 2018

@Jimmi08 Updated above. abs != relative, which is why it worked on the home page, but not others. ;-)

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Oct 2, 2018

@Jimmi08 No much changed. Still not clear. I had to google what is absolute url to be sure. And it's url started with http(s). But if I need to add {e_BASE} to it, it's something different. Relative url is without protocol.
So example of "full" is for me absolute url.
I can live with it, it's not problem.

@Jimmi08

This comment has been minimized.

Contributor

Jimmi08 commented Oct 2, 2018

For me both examples (with slash and without slash are relative). Absolute path has to start with protocol and it's synonym for full path. Generally. Check wiki or any other source.

Ok, in e107 enviroment you call this full path. I pointed this just because this can confuse somebody else too.
So if you write that "abs" starts with backslash and "full" is url with protocol, is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment