Force weblog id on homepage

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Re: Force weblog id on homepage

Postby streeff » Tue Dec 15, 2009 3:00 pm

Harm10 wrote:And if the problem only lies in the homepage why don't you link through directly upon first enter to the correct language page depending on the language of the browser?


Sounds like a good idea. What's the best way to do this on server level?

Harm10 wrote:And another question: is PivotX installed on the homepage level or lower?


Home level.
Evert Albers, Streeff - web // branding // information design - Amersfoort & Amsterdam, NL
Site: http://www.streeff.nl
User avatar
streeff
 
Posts: 146
Joined: Sat Jul 25, 2009 9:28 pm
Location: Amersfoort, NL

Re: Force weblog id on homepage

Postby Harm10 » Tue Dec 15, 2009 7:10 pm

Redirecting can be simply achieved by using meta refresh tag (http://www.pageresource.com/html/metref.htm) but if you want language intelligence in redirecting you can check out many sites/solutions on the internet e.g. http://javascript.internet.com/user-details/language.html or http://javascript.about.com/library/bllang.htm. You can also manipulate your htaccess file to accomplish this (http://tech-blog.borychowski.com/index.php/2009/03/htaccess/redirect-according-to-browser-language-mod-rewrite-and-http_accept_language/)
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2011
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: Force weblog id on homepage

Postby hansfn » Tue Dec 15, 2009 8:35 pm

1) The idea of selecting the correct page according to the browser language is nice and you'll find more info about this if you search (on Google) for "PHP" and "content negotiation". It's the perfect solution, but requires some work - best written as an extension.

2) It's very easy using mod_rewrite (the .htaccess file), to make the frontpage (http://profingreen.com/) being an "alias" for http://profingreen.com/page/over-profin/nl (using an internal redirect in Apache). Probably the line below will do the trick:

Code: Select all
RewriteRule ^$ page/over-profin/nl [L]

The following more elaborate works (and I guess you understand what it does):

Code: Select all
RewriteRule ^$ pivotx/render.php?uri=over-profin&rewrite=page&w=nl [L]

3) What I find interesting is how you have coded the <div class="tag"> part of your page template so it depends on the weblog being correctly set ... Please post the relevant part of your page template. (http://profingreen.com/page/over-profin/nl and http://profingreen.com/page/over-profin should really display the same.)

PS! Please grab a newer version of PivotX from http://pivotx.net/files/unstable-development/ in case the problem is really a bug that is already fixed.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Where would I be without you guys..

Postby streeff » Wed Dec 16, 2009 9:56 pm

Harm, thanks for setting me on another track.

Hans,
Code: Select all
RewriteRule ^$ page/over-profin/nl [L]
already did the trick, so I did not try the other one.

The code is something like:
Code: Select all
[[ if $chapter=="1" ]]
[[ subweblog name="standard" showme="4" order="desc"  category="offshore-wind,onshore-wind,biomass,solar,mobility,general" ]][[ literal ]]
 <div class="item-right">
        <div class="item-right-tagcontainer">
                <div class="date">[[ date format="%day% %month% %ye%" date=$date1 ]]</div>
            [[ include file="skinny/_inc_catblocks.html" ]]
       </div>
<div class="item-right-link"> <a href="[[ link hrefonly=1 ]]">[[ title ]]</a></div>
      </div>
     [[ /literal ]][[ /subweblog ]]
[[ elseif $chapter=="2" ]]


(etcetera)

while the skinny/_inc_catblocks.html (the include) contains the code that gives the different colours:

Code: Select all
[[ if in_array("biomass-nl",$entry.category) ]]
[[ category_list only="biomass-nl" format="<div class="tag">
<a href="%url%" class="biomass" alt="%display%">%display%</a></div>" ]]
[[ /if ]]

[[ if in_array("offshore-wind-nl",$entry.category) ]]
[[ category_list only="offshore-wind-nl" format="<div class="tag">
<a href="%url%" class="offshore" alt="%display%">%display%</a></div>" ]]   
[[ /if ]]


(etcetera etcetera)
Evert Albers, Streeff - web // branding // information design - Amersfoort & Amsterdam, NL
Site: http://www.streeff.nl
User avatar
streeff
 
Posts: 146
Joined: Sat Jul 25, 2009 9:28 pm
Location: Amersfoort, NL

Previous

Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 4 guests

cron