how retrieve the cvalID (collectionVersionAreaLayout) from a view
Permalink
Hi,
Is it possible to have the cvalID from a block controller or block view to know witch class is the parent div wrapper (ccm-layout-wrapper-5)
I see in the layout.php:
I think that a need to take first the blockID to have the layoutID to finnally take the collectionLayoutVersionID ?
Thanks a lot.
Seb
Is it possible to have the cvalID from a block controller or block view to know witch class is the parent div wrapper (ccm-layout-wrapper-5)
I see in the layout.php:
//position and cvalID are properties of the collectionVersionAreaLayout join, set when being loaded for an area, not with layout object itself
I think that a need to take first the blockID to have the layoutID to finnally take the collectionLayoutVersionID ?
Thanks a lot.
Seb
From a blockView i have :
$this->area is the area object. But i really don't find how retrieve the layout object !
$this->area is the area object. But i really don't find how retrieve the layout object !
just took a quick look.
should work with model custom_style.php
should work with model custom_style.php
I don't find there any things about layout.
I want to create a db query..
i have :
- arHandle
- cID
- cvID
but i miss :
- layoutID
mmm
I want to create a db query..
i have :
- arHandle
- cID
- cvID
but i miss :
- layoutID
mmm
Loader::model('layout'); $layouts = LayoutPresets::getList(); $layoutIDs = array(); foreach($layouts as $layout) $layoutIDs[$layout->getLayoutPresetName()] = $layout->getLayoutID();
this might be a start...
btw, pls make more use of phpDOCS, thx
I has and i'm searching in the docs!.. since yesterday morning..
I try your way since a blockView but a var_dump($layouts); return a array(0) { }
and when i try to edit the layout i have a fatal error :
Fatal error: Call to a member function getAreaHandle() on a non-object in /Applications/MAMP/htdocs/geomedia/concrete/tools/edit_area_popup.php on line 27
i'm really sorry for that.
I try your way since a blockView but a var_dump($layouts); return a array(0) { }
and when i try to edit the layout i have a fatal error :
Fatal error: Call to a member function getAreaHandle() on a non-object in /Applications/MAMP/htdocs/geomedia/concrete/tools/edit_area_popup.php on line 27
i'm really sorry for that.
the phpDOCS was meant to the core php models, sry
for an area there exists
$area_layouts = myarea->getAreaLayouts(Page::getCurrentPage());
$area_layouts = myarea->getAreaLayouts(Page::getCurrentPage());
already tested the
var_dump($this->area->getAreaLayouts(Page::getCurrentPage()) );
but
array(0) { } too
cause
the function need the strict arHandle name ('Main') and not 'Main : Layout 1 : Cell 1'.
So i can clean the arHandle with a pregMatch or other but it's not a strong way..
var_dump($this->area->getAreaLayouts(Page::getCurrentPage()) );
but
array(0) { } too
cause
the function need the strict arHandle name ('Main') and not 'Main : Layout 1 : Cell 1'.
So i can clean the arHandle with a pregMatch or other but it's not a strong way..
From a blockView this code can take all the layout from this area.
So now, impossible to retrieve the position or the areaNameNumber !
I think that nobody need that, so it's only for information.
$ar = $this->area->getAreaHandle(); if ( ($areaN = strpos($ar,' :')) !== false) { $areaHandle = substr($ar, 0, $areaN); } else { $areaHandle = $ar; } $db = Loader::db(); $vals = array( intval($this->c->cID), $this->c->getVersionID(), $areaHandle ); $sql = 'SELECT * FROM CollectionVersionAreaLayouts WHERE cID=? AND cvID=? AND arHandle=? ORDER BY position ASC, cvalID ASC'; $CollectionVersionAreaLayouts = $db->getArray($sql,$vals);
So now, impossible to retrieve the position or the areaNameNumber !
I think that nobody need that, so it's only for information.
I think it's now impossible to know the cvalID from a blockView.
Is the core can confirm that ?
Is the core can confirm that ?
I think that i need to :
$page = Page::getCurrentPage();
$thisArHandle = How can i retrieve it?
$a = Area::get($page, $thisArHandle);
.. and after find the $layoutPreset to find the Collection Version Area Layout ?
I'm swimming..