Adding a custom layout to Magento 1.9 - templates

I am trying to add a custom layout to our Magento 1 platform. I followed the instructions located on this page, https://blog.magestore.com/how-to-add-new-layout-template-for-magento/ and I was unsuccessful. I'm looking for advice and instructions on how to accomplish this task.
This is the config file I made
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
<DFSCopper_Page>
<version>0.1.0</version>
</DFSCopper_Page>
</modules>
<global>
<page>
<layouts>
<one_column_wo_name module="page" translate="label">
<label>1 column without name</label>
<template>page/one_column_wo_name.phtml</template>
<layout_handle>one_column_wo_name</layout_handle>
</one_column_wo_name>
</layouts>
</page>
</global>
</config>
Nothing changed when I added this file, and the new template phtml file. The second step in adding the Store_Page.xml file, that file is already present in that folder. That is the only step I was confused on.

Have you tried clearing the cache after creating the new files?

Related

xs3p: handling include-tags

I just wanted to generate a documentation of a schema with xs3p.
The problem is, as far as I understand it, that the schema is split into several files and that xs3p did not process the include-tags of the master file: The result is a documentation containing only the root element.
What did I do exactly?
I unzipped the xs3p-download into a certain directory
I copied all schema files into the directory
I called saxonb-xslt master.xsd xs3p.xsl >doku.html (under Ubuntu Trusty, if that matters)
Can you give me any help? I assume, there are two lines to solve the problem:
Making xs3p process the include-tags
Integrating all xsd-files into a single one — how would this work?
Thank you in advance!
You have to set the following xsl:param in xs3p.xsl :
<!-- If 'true', searches 'included' schemas for schema components
when generating links and XML Instance Representation tables. -->
<xsl:param name="searchIncludedSchemas">true</xsl:param>
<!-- If 'true', searches 'imported' schemas for schema components
when generating links and XML Instance Representation tables. -->
<xsl:param name="searchImportedSchemas">true</xsl:param>
<!-- File containing the mapping from file locations of external
(e.g. included, imported, refined) schemas to file locations
of their XHTML documentation. -->
<xsl:param name="linksFile">xs3p_links.xml</xsl:param>
Your included/imported schemas must have been previously transformed into a my_transformed_included_schema.html file, and you need to define a xs3p_links.xml file in order to assign some imported/included schema to theirs location such as :
<?xml version="1.0"?>
<links xmlns="http://titanium.dstc.edu.au/xml/xs3p">
<schema file-location="my-included-schema.xsd" docfile-location="./my_transformed_included_schema.html"/>
</links>
Hope that'll help !

Informatica XML target Add xmlns and xsi to root and add custom tag

I loaded an XML file via the "Import XML definition" and everything worked fine. But the XML needs the following added to it
Here is my question,
I just have the XML but not the xsd.
How do I add the xmlns and xsi string into the root node?
For the elements, how do I add the tag like 'common' and 'udf' before the column name like common:abbreviation or udf:name or udf:value?
Basically is there an easy and quick way to do this? Do I need to reimport the files with new xsd?
Thanks
<MyRoot
xmlns:udf="http://www.url.com/xx/XXXX/type1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:common="http://www.url.com/xx/XXXX/common"
xmlns="http://www.url.com/ws/v410/NewPerson"
xsi:schemaLocation="http://www.url.com/xx/XXXX/NewPerson NewPerson.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<common:ID>NNNNNNNNNN</common:ID>
<UDF>
<udf:name>Name Content</udf:name>
<udf:value></udf:value>
</UDF>
</MyRoot>
I've written a post about adding ports to XML transformation. See if this helps: http://powercenternotes.blogspot.com/2013/03/adding-port-to-existing-xml-parser.html

Joomla!2.5 not executing SQL files upon install/update

My SQL files aren't being executed when I install or update a new component. Initially I found it weird that my workmate needed to execute his SQL files directly into PHPMyAdmin, but isn't Joomla! supposed to automatically run the files?
Here's how I set up my XML:
ReforcoDigital.xml
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="2.5.0" client="site" method="upgrade">
<name>Reforco Digital</name>
<author>Rodrigo Pereira</author>
<creationDate>14/05/2013</creationDate>
<copyright>Copyright</copyright>
<license>Licença</license>
<authorEmail>rodrigo-c-pereira#hotmail.com</authorEmail>
<authorUrl>http://www.site.com</authorUrl>
<version>0.1</version>
<description>Sistema de Reforço Digital</description>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<files folder="site">
<folder>language</folder>
<folder>models</folder>
<folder>views</folder>
<filename>reforcodigital.php</filename>
<filename>controller.php</filename>
<filename>index.html</filename>
</files>
<administration>
<menu>Reforco Digital</menu>
<files folder="admin">
<folder>sql</folder>
<folder>views</folder>
<filename>controller.php</filename>
<filename>reforcodigital.php</filename>
<filename>index.html</filename>
</files>
</administration>
</extension>
Folder admin/sql has the install.mysql.utf8.sql file, and admin/sql/updates/mysql has the file 0.1.sql; both have the very same SQL code. What am I possibly missing here?
The fact that I was updating my component with a 0.1.sql over and over was the problem. Changed the filename to 0.2.sql and it did the job.
My understanding is that Joomla! will look for the update files in alphabetical order, and judge if that version has been used or not; correct me if that's wrong. Since there was a higher version than 0.1, it did the job.
I commented earlier that I was having the same problem as you, but I'm not. Mine is a completely different problem that I'll describe after I explain what's happening with your file.
So, your sql folder resides within your admin component folder (this is normal), but your install/uninstall sql XML entries don't describe this. So, I believe that if you make this change, you'll find it working as expected:
<install>
<sql folder="admin">
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
My problem is that the update section will only execute a schema update when a schema exists in the #__schema table - and install.sql isn't executed on update. So if you're upgrading your extension and adding a table to it, you can't really rely on the XML installer to create your new table unless your extension already had tables before the update.
I'm going with an install.php file to search for and create the table if necessary.

Multiple artifacts of the module in Ivy

I would like to retrieve jar to a specific folder(like lib) by ivy, below is my retrieve definition in the build.xml:
<ivy:retrieve pattern="lib/[artifact].[ext]" conf="webInfLib" />
And the definition of my ivy.xml like below:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="xxxx" module="xxxx" status="integration"/>
<configurations>
<conf name="webInfLib" description="add jar to web-inf/lib folder"/>
</configurations>
<dependencies>
<dependency org="org.springframework" name="spring-beans" rev="2.5.5" transitive="false" conf="webInfLib -> default"/>
<dependency org="net.sf.json-lib" name="json-lib" rev="2.3">
<artifact name="json-lib" type="jar" m:classifier="jdk15"/>
</dependency>
</dependencies>
</ivy-module>
But it always throws:
impossible to ivy retrieve: java.lang.RuntimeException: Multiple artifacts of the module xxxxxx are retrieved to the same file! Update the retrieve pattern to fix this error.
I have read some similar question and their suggest to change the retrieve pattern to a more complex one. I try something like "[artifact]-revision.[ext]", but not help. And when I execute "ivy.resolve", it work fines. Is there any suggestion about this issue?
The retrieve pattern is the problem that's true.
You are trying
[artifact]-[revision].ext
so I would imagine the binary jar and the source jar would be both written on the same location for any arbitrary dependency. But if you add something unique to the case that you are having
[artifact]-[revision](-[classifier]).[ext]
In the case of a source or doc, the classifier would have a value and therefore would have a different name. In case of no classifier (like the case of the binary compiled jar) there won't be any classifier and this is dealt with by the parentheses ( )

Magento - Inject custom module on product info page

I've searched on web for how to add "block" with my template on the product page. I build my custom module that displays some sort of information and I would like to show that, let's say under the long description of my product.
I've been trying to format the xml layout of my module but without luck.
After some search I've found this: Programatically create Magento blocks and inject them into layout which I can not make it work for me. But it is probably because I've missed something.
My module is structured like this:
CODE: app/code/local/deveti/Countrypurchase
DESIGN: app/design/frontend/default/default/template/Countrypurchase/index.phtml
LAYOUT: app/design/frontend/default/default/layout/countrypurchase.xml
I know the correct way is to edit main layout file, manually add a block, but I'd like to do that on the fly.
EDIT: this works!
So I would do in my module layout xml countrypurchase.xml something like this:
<?xml version="1.0"?>
<layout version="1.0">
<catalog_product_view>
<reference name="product.info">
<block type="core/template" name="product.countrypurchase" as="countrypurchase" template="countrypurchase/index.phtml" />
</reference>
</catalog_product_view>
</layout>
And I've added a call to catalog/product/view.phtml:
<?php echo $this->getChildHtml('countrypurchase'); ?>
And it works ;)
Thank you for your help!
The problem with the product view page is that it's output is mainly controlled by the PHP code in the template catalog/product/view.phtml. Magento doesn't offer much extensibility points out of the box. You could add it to the content block but that would put your custom content either completely at the top or completely at the bottom.
I think you are required to modify the template and add PHP code to render your custom block at the position you want, like:
<?php
echo $this->getChildHtml('product.countrypurchase');
?>
With this in place you can either add your block with the name product.countrypurchase via the XML layout or programmatically.