Standard page


(Loggedon Menard) #1

how can we create a new standard page asset variation?


(Avi Miller) #2

The developer tutorials show you how to create a new asset which inherits from User. You would do the same thing to create a new asset that inherits from Page_Standard.


(Loggedon Menard) #3

asset.xml :


[codebox]

<?xml version='1.0' encoding='UTF-8' ?>

<?xml-stylesheet href="../../asset.xsl" type="text/xsl"?>



<asset_info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../asset.xsd">

<package>cms</package>

<type_code>product_page</type_code>

<version>0.2</version>

<name>Product Page</name>

<description>A Simple asset to retrieve more information about standard page</description>

<instantiable>yes</instantiable>

<allowed_access>backend_user</allowed_access>

<parent_type>page_standard</parent_type>

<requirements>

<requirement type="asset">

<code>page_standard</code>

<version>0.2</version>

</requirement>

</requirements>

<flash_menu_path>Pages</flash_menu_path>

</asset_info>

[/codebox]



my product_page.inc :

[codebox]

<?php



// include the parent type, the user asset

require_once SQ_CORE_PACKAGE_PATH.'/page_templates/page_standard/page_standard.inc';





class Product_Page extends Page_Standard

{

/**

* Constructor

*

* @param int $assetid the asset id to be loaded

*

*/

function Product_Page($assetid=0)

{

$this->Page_Standard($assetid);



}//end constructor



}//end class

?>

[/codebox]



product_page_edit_fns :

[codebox]

<?php

require_once SQ_CORE_PACKAGE_PATH.'/page_templates/page_standard/page_standard_edit_fns.inc';



class Product_Page_Edit_Fns extends Page_Standard_Edit_Fns

{

function Product_Page_Edit_Fns()

{

$this->Page_Standard_Edit_Fns();

$this->static_screens['details']['force_lock'] = 'false';



}//end constructor





}//end class

?>



product_page_management.inc :

<?php

require_once SQ_INCLUDE_PATH.'/asset_management.inc';

class Product_Page_Management extends Asset_Management {



function Product_Page_Management(&$pm)

{

$this->Asset_Management($pm);





}//end constructor





}//end class



?>

[/codebox]



edit_interface_screen_contents.xml :

[codebox]

<contents>

<section name="Contents">

<field>

<function_call>

<paint_function name="redirectToBodycopy" />

<process_function name="redirectToBodycopy" />

</function_call>

</field>

</section>

</contents>

[/codebox]



lang_screen_contents.xml :

[codebox]

<contents>

<section name="Contents">

<field>

<display_name></display_name>

<note></note>

<function_call>

<paint_function name="redirectToBodycopy" />

<process_function name="redirectToBodycopy" />

</function_call>

</field>

</section>

</contents>

[/codebox]

are all my files correct?



pls help me. really need your help.


(Avi Miller) #4

Have you tried running the step_03.php and compile_locale.php scripts? They look fine to me, but I haven't tried installing them. You also haven't explained what you're trying to achieve, so there's no way we can tell you if the files are correct or not.

If you let us know what you want to do, there may be a way to do it without development.

(Loggedon Menard) #5

yup i run the step_03.php and compile_locale.php scripts. what i want is product page extends standard page just like the tutorial a better user extends user.


(Greg Sherwood) #6

Just a note that you dont need the XML files you have listed. They are not different from page_standard so they will be inherited during step_03.php.


The files look fine, although Product Page is not any different from Standard Page. You haven't shown the product_page_management.inc file so I can't tell what additional attributes you are trying to display. You also dont have your own copy of details.xml, which defines the Details screen and the attribute editing interfaces.


(Loggedon Menard) #7

what xml files do you mean? all the xml files?

product_page_management.inc :

    <?php
    		require_once SQ_INCLUDE_PATH.'/asset_management.inc';
    		class Product_Page_Management extends Asset_Management	{
			function Product_Page_Management(&$pm)
			{
				$this->Asset_Management($pm);


			}//end constructor


		}//end class

?></pre><br />


[quote]You also dont have your own copy of details.xml, which defines the Details screen and the attribute editing interfaces.[/quote]

i only have edit_interface_screen_contents.xml (defines the details screen output of the asset) and lang_screen_contents.xml (located in locale/en/). is details.xml a another file?

i just want my product page to have a same funtionality with standard page. no additional attributes added.

(Nic Hubbard) #8

Why not just use a standard page with added metadata?

(Avi Miller) #9

Is exactly the question I would've asked too. :)

(Loggedon Menard) #10

because we are using global layouts for standard pages. which means the rest of the site's standard pages are affected. thats why we want to define our own page(product page) for the current project.

(Nic Hubbard) #11

But couldn't you still use a different design or a paint layout for these specific pages? Or you are wanting an easy way, without having to apply a design or paint layout to specific pages?

(Greg Sherwood) #12

I meant the XML files you have listed in your previous post. But looking at your management class, you are not adding any additional attributes, so this is really just an exact copy with a different type code. So you don't need any XML files or the lang files. They will all be inherited from page_standard.

EDIT: You still need asset.xml though.

(Avi Miller) #13

I think he's referring to Simple Edit layouts, which are system-wide at the moment.

(Nic Hubbard) #14

Ah, gotcha.

(Loggedon Menard) #15

so you got my idea guys. so what file should i edit,remove, or add? what should my Product Page directory look like?


really need your help guys.


(Avi Miller) #16

All the information to create a new asset is on the Matrix website in the Developer. You need to use the examples given for the Better User asset to create your own asset based off standard page. As development is one of Squiz's primary income streams, any more specific assistance needs to be funded. If you would like direct assistance, please contact Squiz Sales to obtain a quote for this development. You can find the Squiz Sales contact details at http://www.squiz.net/contact-us.

(Loggedon Menard) #17

in the asset.xml. how can i determine the asset version?


(Greg Sherwood) #18

If you mean the version of your custom asset, then it is up to you. If you mean of the page_standard dependancy, look in page_standard's asset.xml and use that version.


(Loggedon Menard) #19

when i execute the php install/compile_locale.php


.

.

.

import_tools_manager (Import Tools Manager).

import_tool_converter (Import Tool Converter)…

form (Form)…

listing_engine (Listing Engine Asset)…

form_section (Form Section).

form_submission (Form Submission).

form_email (Form)…

better_user (Better User).

product_page (Product Page)

±-----------------------------------------------+

| PHP Notice |

|------------------------------------------------|

| File : /usr/share/pear/XML/Parser.php |

| Line : 480 |

|------------------------------------------------|

| Only variables should be assigned by reference |

±-----------------------------------------------+

±-------------------------------------------------------------------------------------+

| MySource Warning |

|--------------------------------------------------------------------------------------|

| File : /home/websites/mm3161/install/install.inc |

| Line : 808 |

|--------------------------------------------------------------------------------------|

| Unable to Read File : ./packages/cms/product_page/locale/en/lang_screen_contents.xml |

| XML_Parser: no element found at XML input line 2:0 |

| |

±-------------------------------------------------------------------------------------+



do you have an idea about this?


(Loggedon Menard) #20

i created a product page asset that extends standard page. the only problem is that when i create a product page, it will not be displayed on the asset map and in the preloader section which is found at that bottom of an asset map it display fail instead of success. does anyone of you guys know whats the problem?




we create a product page asset because we are using global layouts for standard pages. which means the rest of the site's standard pages are affected if we do some changes. thats why we want to define our own page(product page) for the current project.





pls help