Excellent idea Cocoaholic!
<strike>If it works i would absolutely recommend going that way. I think the way the EE conditionals work; if you have two embeds in an if then an else, it will parse both embeds before running the conditional, not very elegant but that’s the way it is. That means if your conditional is 10 embeds long you’ll parse 10 pages for each page view. (Can someone confirm this? Check your SQL log on a page using conditionals to embed pages and you’ll see queries from the pages that aren’t being called). If it is the case using a variable in the embed should remedy this.</strike>
You may be able to see it already if the DNS has reached you..
I used your great work here http://www.exaprotect.com/resources/newsletters to switch the language of the newsletter and articles
I also used your fantastic pages module on this site
I’ll put it up in the site introductions with a credit for you once I’m sure the DNS has washed through and after a couple of days of bedding in.
THANK YOU MARK!
Yes that was an issue I’m looking to resolve.
I’m using already using an .htaccess rewrite on the newsletter page
As the switcher extension builds the URL from Segments switching languages was sending it back to /site/etc…
So the quick and dirty solution was to redirect it back. Not ideal and something to tidy up after the launch.
Mmm I did
<?php
echo $_SERVER['PHP_SELF'];
echo $_SERVER['REQUEST_URI'];
?>
and got
/index.php/resources/newsletters
resources/newsletters
I was under the impression that segments get built from the template level which would make sense for the URL that is getting generated.
Array ( [1] => site [2] => newsletter )
I’ve the following redirects:
# Newsletter Archive #
RewriteCond %{REQUEST_URI} /resources/newsletter_archive/$
RewriteRule ^.*$ /resources/newsletter_archive/$ [L]
RewriteRule ^resources/newsletter_archive/(.*)$ /index.php/site/newsletter_archive_detail/$1 [L]
# Redirect translation links #
RewriteRule ^site/news_detail/(.*)$ /resources/newsletters/$1 [R=301,L]
RewriteRule ^site/newsletter/$ /resources/newsletters [R=301,L]
# Newsletters #
RewriteCond %{REQUEST_URI} /resources/newsletters/$
RewriteRule ^.*$ /resources/newsletters/$ [L]
# Newsletter Categories #
RewriteRule ^resources/newsletters/subscribe(.*)$ /index.php/site/subscribe/$1 [L]
RewriteRule ^resources/newsletters/category(.*)$ /index.php/site/newsletter_category/$1 [L]
RewriteRule ^resources/newsletters/(.*)$ /index.php/site/news_detail/$1 [L]
Ok, I think I see now. Glad to know it’s not the extension pushing all those reloads. Basically I see your redirecting the lang/suffix to site/news_detail with is then redirecting to resources/newsletters. I can’t really say if that’s a good thing, but it does appear to be working so I’d go with it. Really I just wanted to be sure that it wasn’t the extension messing up.
Hi Mark - fantastic extension! I was wondering if there’s an easy way to get this extension to switch category custom fields (for example switch the default cat_name to a new custom field called cat_name_fr).
This would take advantage of the new 1.6 features and would save me from maintaining identical category group structures.
What do you think?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.