Problem with custom registration fields in an multistore setup in magento - magento-1.5

I have 2 sites running on my magento platform.
For site2, I added new fields to the registration page and it works properly.
Now, I noticed that when I try to register in site1, on submit I am shown a validation message that the additional fields I have added for site2 are required.
How do I make sure that the additional fields added for site2, are asked only for site2 and not site1?
I have separate themes for both site1 and site2 and both of them have separate register.phtml files.
In the config.xml file for adding custom registration fields, I have this added:
<customer_account>
<employee_id>
<create>1</create>
<update>1</update>
</employee_id>
<doj>
<create>1</create>
<update>1</update>
</doj>
<mobile_number>
<create>1</create>
<update>1</update>
</mobile_number>
<alternate_mail>
<create>1</create>
<update>1</update>
</alternate_mail>
</customer_account>
which is under <global> tag. I assume Magento is reading this. How do I make sure magento reads this config file for a particular site/store? Thanks.

If you want to see the entire XML tree magento has compiled from all XML configuration files:
header("Content-Type: text/xml");
die(Mage::app()->getConfig()->getNode()->asXML());
Will present you with a single compiled XML of their entire tree, this may help in determining if your changes are being added.
Also be sure and checkout Alan Storms CommerceBug as it has this functionality built-in.

How I solved a similar situation is that I added system configuration options to allow me to set which custom field is enabled all the way down to the store view scope. This means I don't need to have separate phtml for the different stores, but can just use the same.
I've also created custom phtml 'widgets' - modelled on the Magento DOB, Gender and Name widgets. The custom widget block code has a 'isEnabled()' method that checks the config flag. In, say, my checkout/onepage/billing.phtml I can say:
<?php $_mywidget = $this->getLayout()->createBlock('mycompany/customer_widget_mywidget') ?>
<?php if ($_mywidget->isEnabled()): ?>
....
<?php endif ?>
Hope this helps.

Related

Liferay 7.4: How to create a configurable web content article footer?

I need to create a footer in a Liferay-project, that can be modified from the instance. I've been trying various things in my footer-code and instance, but haven't figured out how to do it.
Any content inside the footer can't be touched and in page edit mode, Liferay says "This area is defined by the theme. You can change the theme settings by clicking more in the Page Design Options panel on the sidebar". I didn't get any help from Page Design Options either. Is there a way to do this?
I found the answer after hours of work and searching and want to share it with everyone here. The working solution was found here, in one of the comments.
You need to write some code (I use Freemarker/ftl) and then configure the site pages a bit, but here's how it works:
Put a new setting inside liferay-look-and-feel.xml:
<settings>
<setting key="footer-article-id" value="" configurable="true" type="text"/>
</settings>
This will create a new configurable option in page options, allowing you to input the ID of the web content.
NOTE: <theme> might get underlined red "The content of element type "theme" must match". This still prints everything correctly, but the tags are given in a wrong order. Inside my <theme>, I have <template-extension>, <settings> and <portlet-decorator> in that order, which removes the error.
Assign a variable in init_custom.ftl (cleans up the footer-code):
<#assign footer_article_id = getterUtil.getString(themeDisplay.getThemeSetting("footer-article-id"))/>
And then add this to the footer-code, to create the spot, where the content is visible:
<#liferay_journal["journal-article"]
articleId=footer_article_id
groupId=page_group.groupId
/>
After this, everything should be ready code-wise.
Create a Web Content for your footer. In the creation screen, there's an ID on the panel on the right. Publish your content and grab the ID.
Finally, go to Site Builder --> Pages and click on configuration from the top bar (behind three dots). You should see the input field like in the first picture: That's where you add the ID.
Save the settings and your web content should now be in the footer.
Hope this helps!

New pages in Kentico not listing in googlesitemap.xml

Here's the setup:
Root site, set up to show in sitemap and is searchable.
Page under it doesn't get listed in sitemap (in fact, no pages do).
Create a new page with options to show in sitemap and is searchable but is not listed in sitemap xml file
In fact, nothing shows in our sitemap except the location of the robots file.
I understand that initially it only lists CMS.MenuItem objects (as per https://docs.kentico.com/k11/configuring-kentico/search-engine-optimization/google-sitemaps).
Is there a setting I'm missing to show pages in the sitemap?
In case it's important: kentico version is 10.
Make sure your custom page types are configured in the code file:
Either in code before ~/CMSPages/googlesitemap.aspx or code behind ~/CMSPages/googlesitemap.aspx.cs
Since it's similar to a repeater you can set the ClassNames property to identify the different page types you want it to use for rendering.
e.g. when in code before: ClassNames="CMS.MenuItem;CMS.News;Custom.Type"
Resulting in something like:
<cms:GoogleSitemap runat="server" ID="googleSitemap"
TransformationName="CMS.Root.GoogleSiteMap" CacheMinutes="0"
OrderBy="NodeLevel, NodeOrder, NodeName"
ClassNames="CMS.MenuItem;CMS.News;Custom.Type" />

How to add another description block outside the tabs in product detail page

I am using Magento 2.2.4. I need to add a block for product detail outside from the main 'Details', 'Review' tabs. I need this block to be separated after the main description of the product. How can I do this? I have started doing this with a custom theme but no idea how to do this.
Enable Path and block hint from magento admin->configuration->developer->debug
then you can see which block is rendering the product review
then you can move the block by
<move element="Your_block_name" destination="where_to_move" />
dont edit core files ,copy files from vendor->magento->magento catalog to
app\design\frontend\your_namespace\your_theme\Magento_Catalog
then do the changes in respective files,
after change
flush,clean cache, reindex and deploy static content

Need to have separate "complete" Drupal theme for each page on a site

I want to build a Drupal demonstration site where I can create several custom themes and display each on a separate page of the site. Access can be either via links or menu items. The "simpler" the solution the better.
Create a custom block that executes PHP code. The following code snippet should show the current page in the theme set in $custom_theme.
global $custom_theme, $theme;
// If $theme is set, init_theme() will not initialize the custom theme.
unset($theme);
// Set the theme you want to use.
$custom_theme = "garland";
init_theme();
There is also a module that allows you to change the used theme based on some rules (in example, the content type being showed, the URL of the page being viewed, etc): the project page is http://drupal.org/project/themekey.

How to add extra css to SharePoint 2007 site without reverting back to default theme

Currently I'm having trouble adding custom/my own css files to my SharePoint site. I add the custom/my own css files via the c# files (CssLink) as a web part and have them applied to my site's javascript files. Trouble is, whenever the css files were applied, my site goes back to the default blue-ish SharePoint theme color.
Is there any quick and simple way to avoid that from happening?
Thanks.
You can use this method to register a css file from a WebPart
Microsoft.SharePoint.WebControls.CssRegistration.Register("/.../mystyles.css")
or you can add the css file to the content place holder with the id "PlaceHolderAdditionalPageHead" which is present in the master page like this
var placeholder= Page.FindControl("PlaceHolderAdditionalPageHead");
var cssLink = new Literal();
cssLink.Text = "text";
placeholder.Controls.Add(cssLink);
Why don't you use, Site Settings, Master page and use the option "Specify a CSS file to be used by this publishing site and all sites that inherit from it." to specify your own CSS.
(Also, I have no idea what you mean with "via the c# files (CssLink) as a web part and have them applied to my site's javascript files". Are you missing some words in that sentence?)
You should have a very good reason to be adding CSSLink via C#. Have you considered packaging your CSS as your own theme?
SharePoint themes are easy to create and have many benefits such as:
a) Supported by Microsoft
b) Easy to create
c) Manageable by the end users.
d) You can apply different themes to different parts of the site.
e) etc etc...
The process of creating the theme can be found here:
http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=122
I would recommend adding your theme via a feature only for adding and removing the theme. This would add a great deal of options for future tweaking.
Here is an example:
http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/
I'm going to blog about this later this week so keep an eye out of you like. http://blog.zebsadiq.com
Upload your css in the syle library folder(or any library in side your site)
go to -->site actions-->site settings-->modify all site settings-->under look and feel tab-->click master page-->there is one option called alternate css url-->browse your custom css and click Ok.

Resources