How does the country path drupal module work? - drupal-7

I want my Drupal site to be divided:
/uk/en
/uk/fr
/us/en
/us/es
Based on this advice, I was told to use this. The problem is, the module has no configuration page, nor does it have a README. I have scanned the code and it's not immediately apparent how to use it with the Domain Module.
Anybody been able to use this and get it working as described above?

Multilingual support is provided by the Locale core module. To add a new locale(country/language combination) enable the Locale module.
Go to Home » Administration » Configuration » Regional and language » Languages
and add the new locales you need.
Specifically Path prefix language code value will be used to build the url.

Country Path module extends domain access module. You do not have to configure anything except checking 'country path' in 'configuration->languages->detection and selection'. The country suffix will be added automatically based on the country domain selected in your domain record.
Example: I had created three domain records for india australia and singapore with the same URL and was able to access all the three by prefixing /in /au and /sg respectively

Related

Cakephp change defaultLocale on runtime

Have a multilanguage app and i want the admin to be able to specify the "default website built language".
For this ive created a table with language entries that the admin can choose from. Users can then choose the language they want the app in, which ive done with I18n::setLocale(...) in AppController.
The problem is that if the main language the admin sets the site to, does not match config/app.php App.defaultLocale, the app will try to save content in the translation table instead of the main table.
Ive tried using ini_set('intl.default_locale',..) in the boostrap.php, as well as Configure::write('App.defaultLocale',..); and none of them seem to work, however if I alter config/app.php to the desired language specified by the admin the app behaves as expected.
My goal is to specify at runtime the app language so that the behavior matches config/app.php without the need of changing the app.php config file.
We do it this way in AppController:
$locale = ... get locale from URL, session, cookie, database etc.
I18n::setLocale($locale);
CakeTime::setDefaultLocale($locale);

Url Alias not working for domain paths

I'm using domain access module in my website and have multiple domains in my website. For example I have the domains
test.example.com (primary domain)
test1.example.com
When I create a sample content "Contact" and provide it with the URL alias as 'contact' (assume node id as 143), Under domain access options I select "send to all affiliates". When I try to access the below url
test.example.com/contact (its working fine)
test1.example.com/contact (page not found)
But both of these below are working
test.example.com/node/143
test1.example.com/node/143
Is it possible to have the same URL alias for all the domains. I used domain path module and its not working as needed.
Thanks.
In Drupal 7, what happened to me was, each domain had its own language. I'd turned off multi-lingual support on the content types thinking, "if I select the domain I want the content to appear on, it will default to the domain's language". Wrong!
I found that each node was picking up the default language from /admin/config/regional/language . In this case English. The node's language wasn't displayed anywhere, so I missed it. When I tried to view a page assigned to a French URL, clean URLs just won't work. I could access via the /node/nnn, but not the clean URL.
You need to :
edit the content type
in 'Publishing options', 'Multilingual support' set that to enabled.
save
edit the content type again
go to "Manage Display"
'Language' field, set the 'Format' for that to 'Hidden'
save
each each node and either set the language to the domains default OR set to 'Language neutral'
Then sit back and watch those URLs work :-)

CakePHP One Core, One App, One Database, Multiple Domains & Multiple Themes

I am a new addition to the world of CakePHP, and have only created / followed the blog tutorial, and extended it with users. I have been reading the 2.0 book to become more familiar with the framework.
Before I commit to moving to CakePHP, I have a couple of questions.
Currently, I develop a multi domain / multi theme CMS system which is procedural PHP. By doing this I have been able to create a single system on a single database with multiple domains and themes.
I take the $_SERVER['SERVER_NAME'] and look it up in a table of "brands" and then return a brand_id and theme directory. I then suffix all my SQL queries with "and brand_id = X".
I am looking to move over to Cake as the current platform has become overwhelming in size and complexity.
So in short...
Can I create an application with One Core, One App, One Database that can serve Multiple Domains and Themes?
Would I use $_SERVER['SERVER_NAME'] to look up the domain and return back a brand_id and theme?
I don't really want to have multiple databases, as if we had a large number of customers making changes across all databases could prove time consuming.
I certainly don't want to have multiple controllers and multiple models, but in some cases we would want a bespoke view if a customer had a specific requirement.
Any guidance on a basic configuration to get me started would be great. Would each Model "belong to" a "brand"? How would you "serve" up a brand?
Name: Brand1 Domain: www.brand1.com ThemeDir: Brand1
Name: Brand2 Domain: www.brand2.com ThemeDir: Brand2
I have a similar situation in which I am using wildcard subdomains. I accomplished this by doing a combination of things.
In my bootstrap file I am reading in my subdomain and assigning it a value to the cakePHP cache. In my case I am calling:
Configure::write('SubdomainHTTP', $myvalue);
This would be your domain name in your case.
I am loading in my routes.php file a filename called subdomainRoute.php. This file checks to make sure that the route or subdomain in my case exists in the database. It concludes by writing the subdomain name and theme name using Configure::write like step 1.
App::uses('SubdomainRoute', 'Routes');
I glue it all together here, in my AppController.php I read the information I write in step 2. Specifically the theme name and set it using:
$this->theme = $yourtheme;
This should allow you to have different domain name themes. Given you will have to have a database to hold a list of domain names and there theme names.

Create a project section in Drupal 7

i am new to Drupal and want to do the following:
Allow for a simple user registration process
Once the user is registered, allow them to register a project->a project is going to basically have a name, an address and a picture.
Allow for projects to have teams within themselves
kindly guide how to proceed and modules required to do this.
So, there is a core module called "Users". That allows for username creation and authentication. Just go to "admin/modules" and enable it. Then take some time to familiarize yourself with how that works in terms of the experience of creating an account and managing users.
If you require additional login functionality (such as being able to log in using and email address instead of a username), there is a module called LoginToboggan that provides a lot of good functionality
For user profiles, there is a new Drupal 7 module called Profile2 which should meet your needs. Just install it and its dependencies and specify which fields should be in a user profile.
For teams and projects, I think that maybe you're thinking about things the wrong way. Look into the module Organic Groups. That will allow you or users to create their own teams that can then be associated with different nodes.
Finally, create a node type called Project. Specify whatever fields you need for that project. Then, set your permissions so that users can create groups and create new Projects.

Drupal 7 exporting a custom profile to features

I've created some new fields for users who register in admin/config/people/profile
since we are still building the site I want to port these out to a features module
but am completely unable to figure out how to do this? I thought it would be some
thing like Features >> [Create Feature] [Edit components] >> Variables but cannot
find my custom fields?
I named my new form Registration, and tried view sourcing and flipping through the
source with the find command but am unable to find it there either. Anyone know what
it might be called or under?
In order to unlock the profiles, I used this Administer user profiles in Drupal 7 method.
In case you hadn't figured it out yet, you can export fields by selecting the "Fields: field" component when creating your view.
By the looks of your URL you're not using the latest 7.12 core version? Currently the page to manage the fields for user profiles is located at "Administer > Configuration > People > Account Settings > Manage fields" (admin/config/people/accounts/fields) page, so you may need to update...
Did you create a profile or add the fields directly to the user entity?
With the drupal 7 fields API you don't need the profile module anymore in fact it's deprecated. Because of that I don't think their is features support for profiles

Resources