nopCommerce - Dynamic theme activation for different pages - Not multi store - nopcommerce

I was wondering how we can activate different themes on different pages dynamically.
For example few pages will have theme-1 and rest of the site will have theme-2. Users will not be selecting the themes. It will have to be set dynamically from the back end.
One way is to have separate master pages.
But is it possible that we have two nopCommerce themes and we activate any one dynamically on different pages of the same store? Not multi store.

It should be possible following these steps:
Create a new plugin.
Copy the current class ThemeContext, implementing IThemeContext to your plugin. Use a different name to avoid mistakes (see).
Register the new class with Autofac. Set a higher priority to ensure that the new class replaces the old ThemeContext. Enable the plugin and check it works by setting a breakpoint there.
Change the get part of the property WorkingThemeName in your new class and implement any business rules you need, returning the alternate theme name when appropriate. You may need to access the current RouteData to get the current route controller or parameters for each http request.
That's all. It is easier than it looks.

Related

Add custom flow on member registration form in Wordpress website

I have a Wordpress website and want to add custom flow of registration.
The current website has these pages but I am not sure if there is any plugin that has inbuilt such flow feature or how to add this feature.
Any help appreciated.
I had to do a similar modification.
Your case seems the same as mine, its a single form, split onto steps for helping users/validations.
I didn't found any plugin ready for all i needed (the steps thing), and mainly ... hooks to change registration form in wordpress just add extra fields to standard fields, i needed to completly remix the order, so I went the javascript way:
Added my custom css and JS to login/register pages with the action 'login_enqueue_scripts'
Added my custom fields to form using 'register_form' action
Added a class to login body with 'login_body_class' filter, to keep things hidden while JS magic happened;
I'm not sure what's your skill level in JS, but once you got those hooks ready you can make pretty much whatever you want with the register form.

Make an alfresco share site Taggable

I am aiming to make an alfresco site Taggable.
When creating a site, I am looking for a simple way (JS, XML) to let users assign Tags to a site.
It can be done by assigning Tags from Repository to the site folder, but what I want is to add Tag field to the site creation form.
Change the create-site.get.html.ftl use the alfresco\components\form\controls\category.ftl as reference to create the tags field.
Then change the sites.post.json.js in org\alfresco\repository\site and get the tags and add them to the site.
You'll probably also will need to change the client-site JavaScript create-site.js to send the actual tags value to the repository webscript.

Drupal 6.x Add More Module - No end to adding more

Simple question for all of you here dealing with Drupal 6.x...
With Drupal's Add More module, is there a way to configure my webform so that there is no limit on how many of a specific fields I can add more of?
Please see my image for example:
For example, I'd like to enable the user to add as many titles as they would like. Is that doable?
Unfortunately, it's not currently possible to add unlimited "add another" functionality with webforms. And if this functionality does become a reality someday, I doubt it will be backported to the Drupal 6 version of the module. From the webform modules author (quicksketch):
there is no progress on this subject. The ability to support multiple
values requires a tremendous amount of re-architecting, including
changes to the way CSVs are generated, analysis, the database
structure, and the UI (both for administrators and users). I wouldn't
expect this feature to be added any time soon.
See this thread for more information:
http://drupal.org/node/354381
I would suggest using a node and the CCK module plus rules and views to collect this information.
Assumptions:
Anonymous users can fill out the current form
You need some way of retrieving the data that is submitted
Regular users of the site should not be able to view submissions
Very loose directions:
Create a content type and add all of the fields that your current webform contains to it. CCK has the ability to store unlimited values out of the box. On the field settings page, inside the Global Settings fieldset, select "Unlimited" for the "Number of Values" field.
Give anonymous users permission to Create [your-new-content-type] Content on the Role Permissions page.
Using the Rules module, create a new triggered rule that fires on "Content is about to be viewed" with an condition "Content has type [your-new-content-type]" and an action of redirect to homepage (or a custom error page that you created). (Note: this is a bit of a performance hit. There are better ways to restrict access to this content type, but for the sake of this tutorial, this was the easiest to explain)
Using the Views module, create a new view with Style set to Table. Add each of the fields in [your-new-content-type] in the fields section. Under "Access" choose "role" and select the role that is assigned to your user. Add a "page" display, give it a Path and save. This is the page you will use to view submissions.
Optional:
Use the Rules module to send yourself (or the submitter) an email when a node of [your-new-content-type] is created.

Auto-associate page metadata?

Links require SDL Live Content login.
We can choose default schema (and a mandatory option) in folder properties. New components in these folders will have the schema selected with appropriate fields filled out.
We can choose default page template for structure group (SG) properties. New pages in these SG will have the page template selected.
Do we have a similar option for page metadata such that in a given SG, author gets both page template and predetermined page metadata (fields) for either:
page creation
page template selection
We can do this easily with Inline Editing (SiteEdit) and page prototypes. But how would you configure or implement this type of requirement with the Content Manager Explorer?
I'd say there are a number of ways to achieve this:
1) Using the UI 'Page Types' - If the page you are using as the page type this should keep that same metadata. *I've not tested this!!! maybe you could confirm?
2) GUI extension - When a page template is selected a page metadata is selected based on the page template.
3) Event system. I'm not sure how well this would work as it would likely have to be on the creation of the page (checking if a default template is used) or on save if a template is used and a metadata schema isn't selected... but then if there is mandatory metadata etc etc.
4) The page template. This will set the metadata (on publish or preview) - or warn a user that a specific metadata should be set for this given page template.
Hope this helps.
Thanks
John
Very interesting question and I can see the benefits of this functionality for Editors. I don't have the answer for you. But AFAIK, even event system might not be relevant here since there are no events fired when you start creating a page unless we save the page. GUI Extension a possibility?
When you create a new item, this takes place via the GetNewitem() method in the API (or GetNewObject() in old money). I always thought there should have been separate events system hooks for this activity than for that of modifying an existing item. I once suggested this on ideas.sdltridion.com with regard to Components, however someone referred me to the OnSchemaGetInstanceDataPost event hook, and the discussion was over.
So in the case of a new component, the schema is automatically queried, and via the hook, you can interfere with the default data. So far so good, but I still believe that it would be generically useful to be able to modify the default data of any item type when first created.

Drupal 7- How to make a custom module for only front page?

so..I created page--front.tpl.php in my theme directory and it works fine.
now, how do I make a variable that can be used in the page--front.tpl.php?
I can write my php codes inside page--front.tpl.php, but I think there is a better way.
added:
on the front page, I am going to query video and news nodes ONLY. That is why I want to make a new module for only front page.
any suggestions?
I'm not sure what you are trying to achieve here, but OK. You have two options: one is what you're doing now. Write your custom PHP in page--front.tpl.php and you'll be fine. The other is ditching the file and working only with page.tpl.php.
The variable $is_front tells you whether you're on the front page. You can write custom PHP in a conditional block: if ($is_front) { ... }.
Also, you can create a custom block (a view, perhaps, depending on your needs) and set its display restrictions to "only on the listed pages" - and list there. You'll have a custom view loaded only on the front page.
All you need to do have a custom front page is configure your front page in the site information settins (admin/settings/site-information in D6).
Creating a module to display that content is then a completely different thing.
What I would really suggest is looking at Views if you don't know it already. That allows you to build lists of things (nodes, users, ...) and expose them as pages, blocks, rss feeds and much more. You can create a list of nodes with types video and news, expose that as a page and then just point your front page to the path of your view.
you might try using the views module to create your list of videos and nodes. You can set a views page to be your homepage in the site settings.

Resources