Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

FirstChildRedirect as checkbox in page setttings #180

Closed
fourroses666 opened this issue Feb 19, 2014 · 22 comments
Closed

FirstChildRedirect as checkbox in page setttings #180

fourroses666 opened this issue Feb 19, 2014 · 22 comments

Comments

@fourroses666
Copy link
Contributor

My idea is to add a function like [[FirstChildRedirect]] so the client can let a page redirect to the first child instead of adding an ID every time?

Checkbox on tab Page settings?

@mrhaw
Copy link
Contributor

mrhaw commented Feb 19, 2014

Why are you not doing it dynamically: [[id]] This should be discussed in the forums.

@Jako
Copy link
Contributor

Jako commented Feb 19, 2014

Would suggest Weblink and add some code to make [+firstchild+], [+parent+] etc. possible …

@Dmi3yy
Copy link
Collaborator

Dmi3yy commented Feb 20, 2014

You can do checkbox for FirstChildRedirect not see problems

add TV (name: firstchild):
-type checkbox
-FirstChildRedirect==[!FirstChildRedirect!]

add in Template
[firstchild]

use ManagerManager for move this TV in Setting Tab

enjoy )

@fourroses666
Copy link
Contributor Author

Ok Dmi3yy, thats a possibility indeed, thanks!
If you ask me I would love to see it being a default setting 👍

But I can't get it to work,
Input Option Values: FirstChildRedirect==[!FirstChildRedirect!] ?

(to move the tv with MM this works)
mm_moveFieldsToTab('firstchild', 'settings');

redirect

BTW, missing translation: use current alias in alias path

@Dmi3yy
Copy link
Collaborator

Dmi3yy commented Feb 20, 2014

BTW, missing translation: use current alias in alias path

you can help with translate
https://www.transifex.com/projects/p/modx-evolution/

@Dmi3yy Dmi3yy added question and removed bug labels Feb 20, 2014
@Jako
Copy link
Contributor

Jako commented Feb 20, 2014

The string was marked as translated on transifex.

@Jako
Copy link
Contributor

Jako commented Feb 20, 2014

The checkbox is superfluous in most situations and could be achieved with ManagerManager.

Maybe the Weblink input should be extended somehow.

@fourroses666
Copy link
Contributor Author

yea maybe like adding to the dropdown with webpage and weblink the 3rd option: "Weblink with First redirect" ?

@Segr
Copy link
Contributor

Segr commented Feb 27, 2014

Something obscenities... why redirect only to the first child?
May be:
Redirect: select form - none / first child / last child / random child / on child (redirect if child count==1) / parent
And in configuration can edit default value for this param.

@fourroses666
Copy link
Contributor Author

Yup! Redirect to first I use allot but having other choises would be even better

@Dmi3yy
Copy link
Collaborator

Dmi3yy commented Feb 27, 2014

ok do this in 1.1 or 1.0.14

@Dmi3yy Dmi3yy added this to the 1.0.14 milestone Feb 27, 2014
@Segr
Copy link
Contributor

Segr commented Feb 28, 2014

And do not forget change "seo strict URLs" to use this setting

Dmi3yy added a commit that referenced this issue Mar 3, 2014
Bugfix for ‚Prevent XSS exploits misusing the site_url system setting‘
@bossloper
Copy link
Contributor

Also remember FirstChildRedirect defaults to a 301 redirect (Moved Permanently) that may be cached by your browser.

@Dmi3yy Dmi3yy removed this from the 1.0.14 milestone Sep 26, 2014
@fourroses666
Copy link
Contributor Author

🔥 👷 🔥

any plans to do this for 1.0.16?
I like this idea allot but can't use it :(

@fourroses666
Copy link
Contributor Author

🚒

@fourroses666
Copy link
Contributor Author

I'm having troubels with caching. The wayfinder navigation keeps linking to the wrong / old Id.
Maybe there is a possibility to add redirect 301 to .htaccess?

I have a add on to clear cache and its ok again then but my clients don't. Maybe the way FirstChildRedirect uses can be improved/changed?

When using Link attributes it does work good but thats not automaticly changed when an resource is unpublished or new resource is added.

@bossloper
Copy link
Contributor

Quite a while back FirstChildRedirect was updated. The default was changed from a 302 (temporary) redirect to a 301 (permanent) redirect. You will need to add a parameter &responseCode=302 to your FirstChildRedirect calls to prevent the browser caching the redirect. Personally, for a CMS it is quite common to have changing content and site structure and so would make more sense to revert FirstChildRedirect to having a default of a 302 redirect.

@pmfx
Copy link
Contributor

pmfx commented Mar 28, 2015

I agree with bossloper. Default 301 response can lead to unnecessary headache in most scenerios.

@fourroses666
Copy link
Contributor Author

Not sure SEO wise the 302 is good but it could be a solution to add the parameter. I would like to see this option(s) to the settings Tab. I like the idea of Segr.

@bossloper
Copy link
Contributor

RE:302 - The parameter already exists as part of the snippet.
True it is not ideal for SEO, but that is a call you have to make based on how a particular site is managed. If you have a site where you are not the only manager and there are other managers occasionally renaming pages you have to decide between 'better SEO' and 'page not found'. From a usability perspective I cannot have site visitors clicking page links and ending up at a page not found. But if page rename is a rare occurrence for your site you might be ok with that risk.

@fourroses666
Copy link
Contributor Author

Magento does great with automaticly add a rewrite to the new URL.

@Dmi3yy
Copy link
Collaborator

Dmi3yy commented Jan 9, 2016

FirstChildRedirect has setting for set Order and ansver(301,302) i think do this by chekbox in doc not right way. For sample you can use weblink ) or any another way )

@Dmi3yy Dmi3yy closed this as completed Jan 9, 2016
Deesen pushed a commit to Deesen/evolution that referenced this issue Aug 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants