7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Need help to show dataobject on page
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 1948 Views |
-
Re: Need help to show dataobject on page

14 September 2010 at 6:31am
For a single object :
http://www.vspalvelut.fi/katsetus/korterid/show/1
You might want to try this for your controller:
/**
* In template
* <% if Objekt %>
* <% control Objekt %>
* $Objektinimi
* $Kirjeldus
* <% end_control %>
* <% end_if %>
*
*/
function show(){
return array();
}
function Objekt(){
if(isset($this->request) && $this->request->param('ID')){
return DataObject::get_by_id('Objekt', (int)$this->request->param('ID'));
}
} -
Re: Need help to show dataobject on page

14 September 2010 at 6:41am
can u try the code and send me back if u get work seem i need to blonde my hair
-
Re: Need help to show dataobject on page

14 September 2010 at 6:57am
Sorry, I'm not gonna code it for you and I can't explain it easier then I did....
Please take some time for the tutorials I posted earlier. You will gather much more knowledge from it and will write better code in the end...
Also make sure you read this to debug you website:
http://doc.silverstripe.org/debugging
And fresh from the press:
Hope this helps.
-
Re: Need help to show dataobject on page

18 September 2010 at 5:31am Last edited: 18 September 2010 5:35am
is there a way to add in function:
/**
* In template
* <% if Objekt %>
* <% control Objekt %>
* $Objektinimi
* $Kirjeldus
* <% end_control %>
* <% end_if %>
*
*/
function show(){
return array();
}function Objekt(){
if(isset($this->request) && $this->request->param('ID')){
return DataObject::get_by_id('Objekt', (int)$this->request->param('ID'));
}
}the theme .ss file what the objekt.ss dataobject uses
so that if i use nimekiri i use nimiekiri.ss and if i wanna see the more info about the dataobjects listed on nimekiri.ss i use the theme named objekt.ss
in this function it shows the same in mysite.com/nimekiri/ and mysite.com/nimekiri/show/1 (for the last i wanna use the objekt.ss template)
-
Re: Need help to show dataobject on page

18 September 2010 at 5:51am
Use Nimekiri_show.ss to use that template for the show Action.
-
Re: Need help to show dataobject on page

18 September 2010 at 7:04am
one more question
in searchable fields in objekt.php
what i need to add in my language file and this part of file to translate the search fieldstatic $searchable_fields = array(
'Elamutyyp' => array(
'title' => 'the translation code',
'filter' => 'ExactMatchFilter',
), -
Re: Need help to show dataobject on page

18 September 2010 at 7:50am
static $searchable_fields = array(
'Elamutyyp' => array(
'title' => 'sprintf(_t('ClassName.ELAMU',"Elamutüüp")),$title)',
'filter' => 'ExactMatchFilter',
),is this right??
| 1948 Views | ||
| Go to Top | Next > |


