# Extend class and not substitute pages but add new

**URL:** <https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789>\
**Category:** English forums\
**Tags:** basics\
**Created:** [November 16, 2011, 10:18am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789 "2011-11-16T10:18:04Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![XAR](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/x/977dab/32.png) [@XAR](https://forum.oxid-esales.com/u/XAR)\
**Post date:** [November 16, 2011, 10:18am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/1 "2011-11-16T10:18:04Z")

</div>

I need to make product list pages with practically no design (for export purposes) in addition to existing product list pages. So far I managed only to alter the designs of existing pages. But I need both existing product list pages and my alternative list pages to work (with different urls, obviously). How can I achieve this? Tutorials aren’t clear about how to create totally new pages using existing classes.  
Any advice would be really appreciated!

---

<div class="post-metadata">

**Author:** ![Hebsacker](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/hebsacker/32/45_2.png) [@Hebsacker](https://forum.oxid-esales.com/u/Hebsacker)\
**Post date:** [November 16, 2011, 10:19am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/2 "2011-11-16T10:19:11Z")

</div>

for Export?

Why not have atry with the RSS?

---

<div class="post-metadata">

**Author:** ![XAR](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/x/977dab/32.png) [@XAR](https://forum.oxid-esales.com/u/XAR)\
**Post date:** [November 16, 2011, 10:46am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/3 "2011-11-16T10:46:45Z")

</div>

I need more data than standard RSS shows and I have to preserve everything, even RSS feeds, exactly as it currently is.

---

<div class="post-metadata">

**Author:** ![rafaeldabrowski](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rafaeldabrowski](https://forum.oxid-esales.com/u/rafaeldabrowski)\
**Post date:** [November 16, 2011, 10:57am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/4 "2011-11-16T10:57:07Z")

</div>

To answer your question: you have to look in the /views folder

You can copy and paste/rename the file “alist.php” rename the class allso to lets say: “whatever”

Now you can reach this Site with “[www.yourshop.com?cl=whatever](http://www.yourshop.com?cl=whatever)”

with “[www.yourshop.com?cl=whatever&cnid={CATEGORYOXID}](http://www.yourshop.com?cl=whatever&cnid=%7BCATEGORYOXID%7D)” you will get the aproriate category list.

To sum it up:

- Files in the /views folder are new Pages.
- They need to contain classes which extends oxUBase
- You can reach them by addin the URL Parameter: cl={classname}
- At least this class needs one function render() which calls

```auto
parent::render()

```

and returns the path to a Template(starting from /out/{template}/tpl/).

Regards

Rafael

---

<div class="post-metadata">

**Author:** ![MBa](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@MBa](https://forum.oxid-esales.com/u/MBa)\
**Post date:** [November 16, 2011, 11:06am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/5 "2011-11-16T11:06:29Z")

</div>

Don’t need a new class.

Just try:

```php

alternativeTemplate4aList extends alternativeTemplate4aList_parent{
  public function render(){
    $sParent=parent::render();
    return 'true' == oxConfig::getParameter( 'altTemplate' )?'myListingTemplate.tpl':$sParent;
  }
}

```

```auto

alist=>alternativeTemplate4aList

```

… and you need a new List-Template ‘myListingTemplate.tpl’.

Normal Url:  
[example.com/path/to/category/](http://example.com/path/to/category/)

With alternative Template  
[example.com/path/to/category/?altTemplate=true](http://example.com/path/to/category/?altTemplate=true)

---

<div class="post-metadata">

**Author:** ![rafaeldabrowski](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rafaeldabrowski](https://forum.oxid-esales.com/u/rafaeldabrowski)\
**Post date:** [November 16, 2011, 12:01pm UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/6 "2011-11-16T12:01:03Z")

</div>

[QUOTE=MBa;73490]Don’t need a new class.

Just try:

```php

alternativeTemplate4aList extends alternativeTemplate4aList_parent{
  public function render(){
    $sParent=parent::render();
    return 'true' == oxConfig::getParameter( 'altTemplate' )?'myListingTemplate.tpl':$sParent;
  }
}

```

```auto

alist=>alternativeTemplate4aList

```

… and you need a new List-Template ‘myListingTemplate.tpl’.

Normal Url:  
[example.com/path/to/category/](http://example.com/path/to/category/)

With alternative Template  
[example.com/path/to/category/?altTemplate=true[/QUOTE]](http://example.com/path/to/category/?altTemplate=true%5B/QUOTE%5D)

Actually this is already implemented: ?tpl={path to template}  
ie.: [www.shop.com/Category?tpl=myListingTemplate.tpl](http://www.shop.com/Category?tpl=myListingTemplate.tpl)

But he wanted to

> … Tutorials aren’t clear about how to create totally new pages using existing classes…

Regards

Rafael  
[

---

<div class="post-metadata">

**Author:** ![XAR](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/x/977dab/32.png) [@XAR](https://forum.oxid-esales.com/u/XAR)\
**Post date:** [November 17, 2011, 10:30am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/7 "2011-11-17T10:30:33Z")

</div>

Works OK, but how do I get a list of all products in the whole shop on one page?

---

<div class="post-metadata">

**Author:** ![rafaeldabrowski](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rafaeldabrowski](https://forum.oxid-esales.com/u/rafaeldabrowski)\
**Post date:** [November 17, 2011, 11:02am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/8 "2011-11-17T11:02:18Z")

</div>

```auto

$allProducts = oxNew("oxarticlelist");
$allProducts->loadPriceArticles(0, 9999);

```

if you do not hav a product with a price higher than 9999{$currency}

Alternatively you extend oxarticlelist with a function with gives you all products via a databasequery.

Regards

Rafael

---

<div class="post-metadata">

**Author:** ![rafaeldabrowski](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rafaeldabrowski](https://forum.oxid-esales.com/u/rafaeldabrowski)\
**Post date:** [November 17, 2011, 11:17am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/9 "2011-11-17T11:17:16Z")

</div>

The Databasequery should look like this to get all products:

```php

public function getAllArticles()
{
  $sArticleTable = getViewName('oxarticles');
  $oBaseObject = $this->getBaseObject();
  $sFieldNames = $oBaseObject->getSelectFields();
  $sSelect = "select $sFieldNames from $sArticleTable ";
  $sSelect .= "WHERE " . $oBaseObject->getSqlActiveSnippet() . " and $sArticleTable.oxparentid = '' "; //only active and no variants

  if ( $this->_sCustomSorting ) {
    $sSelect .= " ORDER BY {$this->_sCustomSorting} ";
  }
	 
  $this->selectString( $sSelect);
  return $this->count();
}
		 

```

Regards

Rafael

---

<div class="post-metadata">

**Author:** ![XAR](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/x/977dab/32.png) [@XAR](https://forum.oxid-esales.com/u/XAR)\
**Post date:** [November 17, 2011, 11:49am UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/10 "2011-11-17T11:49:47Z")

</div>

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Hebsacker](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/hebsacker/32/45_2.png) [@Hebsacker](https://forum.oxid-esales.com/u/Hebsacker)\
**Post date:** [November 17, 2011, 12:15pm UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/11 "2011-11-17T12:15:15Z")

</div>

maybe this one helps?

> **[Tschüss, winke winke und: Da bin ich wieder!](https://www.shopcockpit.com/de/tschuess-winke-winke-und-da-bin-ich-wieder.html)**
>
> Tschüss, winke winke und: Da bin ich wieder! - “Sag beim Abschied leise…”. Ach was. Nichts da! Aber es ändert sich doch einiges. Was war 13 Jahre BETA Company sind seit dem 31.12.2015 zu Ende. 13 erfa

---

<div class="post-metadata">

**Author:** ![XAR](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/x/977dab/32.png) [@XAR](https://forum.oxid-esales.com/u/XAR)\
**Post date:** [November 17, 2011, 2:53pm UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/12 "2011-11-17T14:53:48Z")

</div>

[QUOTE=Rafael Dabrowski;73594]The Databasequery should look like this to get all products:

```php

public function getAllArticles()
{
  $sArticleTable = getViewName('oxarticles');
  $oBaseObject = $this->getBaseObject();
  $sFieldNames = $oBaseObject->getSelectFields();
  $sSelect = "select $sFieldNames from $sArticleTable ";
  $sSelect .= "WHERE " . $oBaseObject->getSqlActiveSnippet() . " and $sArticleTable.oxparentid = '' "; //only active and no variants

  if ( $this->_sCustomSorting ) {
    $sSelect .= " ORDER BY {$this->_sCustomSorting} ";
  }
	 
  $this->selectString( $sSelect);
  return $this->count();
}
		 

```

Regards

Rafael[/QUOTE]  
OK, I can insert this getAllArticles() procedure into a template.  
But, again, how to create totally new URL for this kind of output?

---

<div class="post-metadata">

**Author:** ![rafaeldabrowski](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rafaeldabrowski](https://forum.oxid-esales.com/u/rafaeldabrowski)\
**Post date:** [November 17, 2011, 2:56pm UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/13 "2011-11-17T14:56:18Z")

</div>

[QUOTE=Rafael Dabrowski;73488]To answer your question: you have to look in the /views folder

You can copy and paste/rename the file “alist.php” rename the class allso to lets say: “whatever”

Now you can reach this Site with “[www.yourshop.com?cl=whatever](http://www.yourshop.com?cl=whatever)”

with “[www.yourshop.com?cl=whatever&cnid={CATEGORYOXID}](http://www.yourshop.com?cl=whatever&cnid=%7BCATEGORYOXID%7D)” you will get the aproriate category list.

To sum it up:

- Files in the /views folder are new Pages.
- They need to contain classes which extends oxUBase
- You can reach them by addin the URL Parameter: cl={classname}
- At least this class needs one function render() which calls

```auto
parent::render()

```

and returns the path to a Template(starting from /out/{template}/tpl/).

Regards

Rafael[/QUOTE]

This is the totaly new URL … or am i wrong ?

or du you mean a seo url like [www.shop.de/all-products](http://www.shop.de/all-products) ?

regards

Rafael

---

<div class="post-metadata">

**Author:** ![XAR](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/x/977dab/32.png) [@XAR](https://forum.oxid-esales.com/u/XAR)\
**Post date:** [November 17, 2011, 3:12pm UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/14 "2011-11-17T15:12:54Z")

</div>

This keeps redirecting me to home page.

---

<div class="post-metadata">

**Author:** ![rafaeldabrowski](https://forum.oxid-esales.com/letter_avatar_proxy/v4/letter/r/e9bcb4/32.png) [@rafaeldabrowski](https://forum.oxid-esales.com/u/rafaeldabrowski)\
**Post date:** [November 17, 2011, 3:13pm UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/15 "2011-11-17T15:13:45Z")

</div>

if you got some errorrs in you code it is no wonder 😉 can you please provide your code ?

regards

Rafael

---

<div class="post-metadata">

**Author:** ![system](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/system/32/4245_2.png) [@system](https://forum.oxid-esales.com/u/system)\
**Post date:** [July 13, 2026, 7:38pm UTC](https://forum.oxid-esales.com/t/extend-class-and-not-substitute-pages-but-add-new/53789/16 "2026-07-13T19:38:56Z")

</div>

Closed on July 13, 2026, 7:38pm UTC


