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

Disable for individual pages #17

Closed
stefanschleich opened this issue Jun 2, 2017 · 7 comments
Closed

Disable for individual pages #17

stefanschleich opened this issue Jun 2, 2017 · 7 comments
Labels

Comments

@stefanschleich
Copy link

stefanschleich commented Jun 2, 2017

I think it would be useful to have the ability to disable the functionality for certain pages in the site structure.

In my case I created a landing page where I moved $this->head; in fe_page.html5 from the <head> to the end of the <body> to prevent JS-files from blocking DOM rendering. This leads to having <meta> tags in the body. I know this is an edge case but maybe it could be useful in other scenarios too.

@fritzmg
Copy link
Contributor

fritzmg commented Jun 2, 2017

This makes no sense, as you would have to do that for every extension that puts something into the <head>. Instead you should simply move only the JavaScript out of there.

@qzminski
Copy link
Member

qzminski commented Jun 2, 2017

If you want to disable the social images just create another page layout and turn it off there.

$this->head as its name says is made especially for the <head> section and if you would want to move JS to the bottom of the page you should use either some regexp or adjust the extensions accordingly.

@stefanschleich
Copy link
Author

This makes no sense, as you would have to do that for every extension that puts something into the . Instead you should simply move only the JavaScript out of there.

You're right, but how would I get the files I defined as static in j_scripts.html5 to NOT get added to the header but to any other place instead?

If you want to disable the social images just create another page layout and turn it off there.

I just did but it has no effect. The tags are written even with social images not activated in the layout.

@fritzmg
Copy link
Contributor

fritzmg commented Jun 2, 2017

You're right, but how would I get the files I defined as static in j_scripts.html5 to NOT get added to the header but to any other place instead?

You can use extensions like Theme+ for that, may be also Supertheme. Or you do it with your own PHP script.

@stefanschleich
Copy link
Author

You can use extensions like Theme+ for that, may be also Supertheme.

I'll have a look. Thanks!

@qzminski
Copy link
Member

qzminski commented Jun 2, 2017

I just did but it has no effect. The tags are written even with social images not activated in the layout.

Are you 100% sure it's not working? This line should prevent that https://github.com/codefog/contao-social_images/blob/master/classes/SocialImages.php#L103

Where do you add the social images in this case? Page settings, content elements, news, etc.?

@stefanschleich
Copy link
Author

Are you 100% sure it's not working?

I just updated from version 3.2. to 3.3. and now it works. Sorry for the trouble.

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

No branches or pull requests

3 participants