Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » public function BlogEntries

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 860 Views
  • Garrett
    Community Member
    245 Posts

    public function BlogEntries Link to this post


    How is it that using this function, with DataObject::get('Page', etc.), we are able to separate the Tags into individual links on the template level ($Link?tag=$Tag), but if I try to customise the query using DB:query(), all I get back from the BlogEntry table is the Tags column as one solid block?

    Because I need to do a couple of JOIN's, I need to use DB:query():

    SELECT ST.Title, ST.Content, ST.URLSegment, BE.*, F.FileName AS ListingImage FROM BlogEntry BE
    JOIN SiteTree ST ON ST.ID = BE.ID
    LEFT JOIN File F ON F.ID = BE.ListingImageID


    foreach($item as $sqlResult) {
    $Tags = $sqlResult['Tags'];

    $results->push(new ArrayData(array(
    "Tags" => $Tags,
    return $results;

    How can I pass the Tags back pre-split? They're already inside an array. Help!


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.