473,325 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

different output depending on folder name

3
Hi,
I am working on a website (set-up in Wordpress) in 5 languages, each language is in one folder: domain.com/en/, domain.com/es/ etc.

Now I want for example in the sidebar and in the header to appear content depending on the language (=folder).

For example: If I am on any page inside the folder ../en/, I want to show the site menu only with the sites in english, in the sidebar I want to show the links and Ads in english etc.

My php knowledge is pretty limited, so I would be happy if somebody could help me with some advice.


Thanks a lot!
Jan 30 '10 #1
5 1495
Dormilich
8,658 Expert Mod 8TB
if your language specific folder contains all necessary files, you can use relative path names and you shouldn’t have further problems to include headers, footers, sidebars, etc.
Jan 30 '10 #2
maraa
3
Hi Dormilich, thanks for your reply.

I am using Wordpress as a CMS for this website, so there ist no "real" folder structure, all the content is in the data base and the layout uses the same templates for all languages.
So I have one sidebar file and one header file for the whole website. Within those files I need to put different content, depending on the language. How do I detect the language then?
Some kind of function which checks if the current page URL contains the folder /en/, /es/, etc.
"if the url contains /en/, show me sidebar content for /en/..."

I hope you understand my idea?! ;-)

Thanks for your help!
Jan 30 '10 #3
Dormilich
8,658 Expert Mod 8TB
do you know, whether the URL is passed through mod_rewrite? (then you would probably have a variable with that value) maybe this is mentioned somewhere in the wordpress documentation.
Jan 30 '10 #4
maraa
3
yes, the site is using mod_rewrite to rewrite the urls. how can i get a variable out of that?
Jan 30 '10 #5
Dormilich
8,658 Expert Mod 8TB
that must be mentioned in the documentation. otherwise, if you have access to the .htaccess file (which I doubt), you could look it up there.
Jan 30 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: CJM | last post by:
I have an ASP page that lists files and folders in a directory. I'm using a cookie to record the last time this page was visited, and I intend to show links that are created/modified from that date...
8
by: Sebastian Kerekes | last post by:
Greetings, I'm developing an application that supports multiple languages. In my XSL I use variables to place the text where it belongs to. At the top of the document I include those variables -...
0
by: Andy | last post by:
Hi all, I'd like to have an App.config file for development, then when I build the deployment package (using one of the VS.net projects), i'd like to specify a different .config file to install...
2
by: | last post by:
I have just about finished my project and need to change the name of the ..exe file created by the Windows Installer to the real name. I was developing naming the solution and project MyProject,...
0
by: Paul Aspinall | last post by:
Hi I am writing a system which will form part of a warehouse management system, running over a corporate intranet. The system will print labels to TCP/IP Zebra printers. I want to direct the...
3
by: empiresolutions | last post by:
I'm trying to build my first PHP Class. After days of tweaking, im lost. I am used to working with functions and arrays, but wrapping them in classes is confusing me. The following code is to...
1
by: Rahul83 | last post by:
Hi.. I have written a perl script for displaying the difference between two directory structures.(including the diffferences in the files) I have to generate the output in a log file. ...
0
by: Andy B | last post by:
I am using web deployment projects combined with web application projects in Visual Studio 2005. I have some projects in the solution called Main and InHim. I noticed some wierd compiled output in...
4
by: Jon F | last post by:
Hi everybody, I have a plain good ol' HTML website that currently hosts several localized versions of pages. That is, depending on the address/domain that users enter into their browser, the...
9
by: jay123 | last post by:
hi all, what i am trying to do is i have three folders 1) sentto 2) error 3) sent i am using web services in which we give the name of XML file ( which is in sentto folder. when the name...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.