Howdy -- I have created the ability for site owners (i.e. non-technical front-end users) to customize their site header and footer (e.g. site logo, tagline, etc.) by associating TVs with @INHERIT bindings to a parent resource called ’Global Settings’. This isn’t published, but all other resources of the sites (published or otherwise) are its children. The TVs have placeholders in the site header/footer chunks, allowing these global values to be set in one place and to appear on all Web pages that include those chunks.
This works great with one exception -- the URL includes the unpublished parent document. So, as an example, if I navigate to the news page, the URL is http://site-URL/global-settings/news. Is there a way to prevent "global settings" from appearing in the URL?
Thanks for the help!
Nevermind -- think I figured this out:
[tt]Options +FollowSymLinks
RewriteEngine On
RewriteRule ^news, contact, etc.(/(.*))?$ /global-setting/$2 [QSA,L]
RewriteRule ^$ /modx/ [QSA,L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule !^(news|contact|etc|global-settings)(/.*)?$ /modx%{REQUEST_URI} [QSA,L][/tt]
-
☆ A M B ☆
- 3,141 Posts
Previously, we’d simply put the header/footer stuff in Chunks. All other chunks we don’t want our clients to touch have been protected.
TVs should be used to have different content for different resources, even though the template remains the same.
If you’re really sure you don’t want to use a chunk, I’d even prefer making a single document and access its values with a snippet using the API. Seems much cleaner imo.
I am using chunks. There’s a header and footer chunk, both of which are customized via TVs with @INHERIT as a default. When the site owner sets their values on the global setting page, those values are inherited by all pages of the site. Originally, I associated the TVs to the homepage but even though the header/footer chunks are used by all pages, the TV values showed up only the homepage.