For our Drupal 7 Commerce site we are trying to create a "portal system". I have it set up with all of the content at this point with all of the content referencing the same taxonomy to filter the respective products and content into either "portal one", "portal two", or both in the same. I have also already set up all the views and content types to display the content appropriately. Everything is 100% but now I need to use either session data or cookies to let the user (anonymous and authenticated) to choose from a pop up with "portal one" and "portal two" (this is already created as well) and change the urls on the main menu accordingly.
Currently the site is set up to have testsite.com/portal1/products as the url for portal 1 products and test site.com/portal2/products as the url for portal 2. The urls are set up exactly the same as this for all of the other content and views.
I also realize that this will get somewhat complex when dealing with users entering the site to internal links. A logic diagram has already been laid out, but that is a point of concern as well.
Session data or cookies would be the way to go. You would want to set this when the user selects a portal. Then, you would check that the user is on the right portal by getting the current url. I'm positive there is a Drupal hook for this.
For reading the cookie/session data there are a couple ways to do this. Firstly, you would probably need to create a module to do this. Drupal has rules and hooks so that you could run your portal routing code only on specific pages. The other option is to run that code on every page load, but that is not recommended by Drupal and it's followers.
Related
In the Wordpress Menus Custom Links, I want to create a page called "My Page", and when the Current User clicks this Custom Link, it takes him to his specific page.
E.g mydomain.com/%CURRENT USERNAME% /
mydomain.com/johnsmith
Reading other posts, it appears that the Wordpress Custom Link understands only a static URL, not a dynamic one.
Therefore I need some way for the system to "get" the current user info, and redirect accordingly.
I have viewed the replies at this previous thread and here but I am still lost.
My coding ability is even less than the first guy's (but I do try!), so I can understand the theory, but I don't understand the technical language.
Therefore, I understand "You need to place this code, in your Theme Functions/in the script of the page".
But I don't understand "You need to run a jQuery with this code"
What information can I enter in the Custom Link to achieve this?
What code do I need to enter in the back-end to read this information correctly?
Thank you very much.
I have a content type named Ailment, which displays all the ailments of the particular user, when u click the ailment, it goes to a particular node, displaying details and graphs of that ailment which is added by the user, this is fine.
Now in another page I wan to search ailment of the whole site and display the ailments, and when they click the ailment it should show the graphs and should hide some fields which shows only for the particular user..
For ex: user A is having a page where ailments wil be listed, when he clicks the ailment, for example cancer, then it goes to myailment/cancer, where some fields and graphs wil be displaying.. this is fine
Now I am having a another page /topailment, where I have a search box, any user can come and search any ailment, it should display the ailment for example cancer, then it should go to the page, topailment/cancer, where it should display only graphs and hide fields..
Hope I am clear..
I am trying to find a solution but going no where...
Please help
Thank you.
this is possible with Page Manager. It will take some learning, but the best place to start is here:
http://nodeone.se/en/learn-page-manager-part-1-overview
Essentially, you want a node to have two different page displays. There are several ways to do this, but page manager is the most direct for me.
Good luck!
Mike
As is always the case in Drupal, there are many ways you could do this. Two options come to mind immediately:
Use views and create a view with multiple displays to renders your Ailment nodes in different ways.
Create custom display modes using the Display Suite module.
You could even go for a blend of both options by creating additional display modes with Display Suite and rendering those display modes with views.
To do it purely with Display Suite: once display modes are configured, you can enable the 'View mode per node' option made available by Display Suite Extras (bundled with the core module) and pass the view mode as a URL parameter to the node. This way you would link to your node as normal from most pages and from the user page you would link to (for example) node/123?v=personalized to use the personalized display mode.
Which of these approaches you go for probably depends on your familiarity with these modules and what you're already using.
There is a module for that :) . It solves this specific problem and plays very nicely with display suite for hiding modules. You have to create a new view mode, assign it to your content type, select which fields you want to hide for each view mode and then you create a URL in your manage fields section for that particular view mode. https://www.drupal.org/project/view_mode_page
Let's say I'm making a blog in Drupal 7, and I want my end user to see a link: "Add Post", and when he clicks on that link he can add a new content. But instead of the default administration page, is it possible to create a new one, which has just the post title, tags, message and etc?
I've been searching for 2 days now, founding nothing about where to start/how to start a specific administration page instead of the default one.
You will have to create a specific module for that which will:
define the blog post editing form you want to have
define a page through a hook_menu function that includes the form
define a menu entry for it in the administrative menu
etc.
You should really get a little more into extending drupal by reading some pro drupal 7 book.
At least start reading http://drupal.org/node/1074360
Another very good starting point is the drupal "examples" module, which provides example code for most things your modules need to do:
http://drupal.org/project/examples
You could probably do all you need to by adding a template for the blog posting page to your theme. This lets you customise the display of the form, without needing to get too deep into Drupal programming.
Alternatively, you could create a module to replace the default blog submission form with one if your own design.
The theming and module design guides on the Drupal website give lits if detail on both these approaches.
James
you can have a different theme for management section, you can have multiple permissions depending on role, you can customize any page using ***node.tpl
Every add/content_type is a form. Forms can be altered with hook_form_alter or hook_form_id_alter.
If you want to have different fields that are shown for different roles, first see if it could be done on the admin/people/permissions page, if not write extra if conditions inside the form_alter.
e.g. check user role:
global $user;
// Check to see if $user doesn't have the administrator role.
if (!in_array('administrator', array_values($user->roles))) {
// Alter the form
}
You can check the form variables with dpm($form) when the Devel modules is enabled.
I'm new to Drupal and have a basic question which I cannot find a good answer to. I am trying to dynamicly determine the contents of my website based on a selection made by the user and keep the selection displayed in the routing for SEO purposes.
It's a website for a Restaurant with multiple franchises.
What i'm trying to do is the following:
The user visits my website and gets a splash screen presented with the available franchises or a textbox to enter his postalcode
Upon selecting he enters the main website with the navigational structure adapted to the selected franchise. For example: domain.com/city/, domain.com/city/menu, domain.com/city/menu/dishes, domain.com/city/contact, ...
The contents of all nodes are based upon the city the user selected. Some franchises have extra nodes which should be displayed in the main navigation aswell.
What I have thought about so far is to try to accomplish this with taxonomy but I really have no idea where to start. Parts of the nodes will be the same for all franchises other parts will be different. Menu item prices will also be different.
This is the first website i'm building using Drupal so any advice is welcome.
Thanks!
It will be impossible to explain it all here but yes it is possible to select your content based on user input in Drupal. You will need to look into Views & Panels.
In Views you can use arguments to narrow to a specific taxonomy. With Panels , an argument can be retrieved fron the URL and passed to the Views in order to display the results.
There are a lot of resources available, Merlin of Chaos, the author of the Views & Panels modules has written a book about it. There are video tutorials online. Your best bet is to start with drupal.org.
I've got a client site that will have multiple "mini-sites" for individual web shows and one main site for the company that produces them. Each mini-site has it's own color scheme but has all the same menu items and/or content of the other site such as Photos, News, etc.
I can't seem to figure out how to ensure programatically that the stylesheet I associate with a given mini-site is retained for all interaction within the mini-site, until and unless a user leaves to the HOME page or changes SHOW from the shows menu.
It's possible that I would even use different virtual hosts for the mini-sites, so I want it to feel like they are completely different sites, but rather than maintain multiple instances of the CMS with the same content, they really are powered from one CMS.
I've thought about using JSession to manage sessions, and then grabbing the current mini-site name from session, changing only when a user selects the HOME page, or changes their SHOW from the shows menu. Alternatively I could try to have multiple templates and try to associate them to specific menu items, but that feels a bit ugly.
Does anyone have experience building sites like this in Joomla (or any CMS), and is there a best practice for this?
I think I will have separate sub-menus for each mini-site, so that Photos on each site is a link to a specfic gallery within the photos component, whereas Photos from the main site is a link to the main photo gallery.
I don't really get what you are trying to achieve from your question, but i decipher your question to be
You have multiple sites, [SITE A, MenuA, MenuB, MenuC] , [SITE B, MenuA, MenuB, MenuC] , [SITE C, MenuA, MenuB, MenuC].
2.
Each mini-site has it's own color scheme but has all the same menu items
Does this mean Menu A pointing to siteA, menu B pointing to siteB, MenuC pointing to site C, All menus are the same on each site.
why not have the same template on multiple sites with Different styles, such that If you have the same template, TemplateA, with styleA on siteA, styleB on siteB and styleC on siteC.
And if we are talking about multisites and styles. Are they on the same domain? i.e siteA.yourdomain.com, siteB.yourdomain.com, siteC.yourdomain.com I just learned this from a colleague, apparently you could actually use cookies by posting them to *.yourdomain.com and they will be accessible from all subdomains. Otherwise if the domains are totally differently it won't work for security reason. Something you might want to try
Sorry if i missed it, but maybe an taxonomical scenario will make more sense
Regards!