633 Posts in 170 Topics by 237 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1235 Views |
-
Help for widget open in new page

1 June 2009 at 11:41pm
Hi experts,
here with attache my jpeg image.
I query is .. i have created one widget .It shows in pages.When i click the widget it must open in new page.
Now i cant able to show in seperate page. how to create my widget holder page.Please give some advice.
Thanks -
Re: Help for widget open in new page

2 June 2009 at 1:35am
hi experts
Please give some advice to my issue
Thanks -
Re: Help for widget open in new page

2 June 2009 at 7:14am Last edited: 2 June 2009 7:15am
Hello,
<br >as i understand - you want make page wich will contain your widget as page content.
<br >Therefor you should make new page type, for instance HomePage.php:
<br ><br ><?php
<br >class HomePage extends Page {
<br > static $db = array(
<br > );
<br > static $has_one = array(
<br > "Widget" => "WidgetArea",
<br > );
<br >
<br > function getCMSFields() {
<br > $fields = parent::getCMSFields();
<br > $fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Widget"));
<br > return $fields;
<br > }
<br >
<br >}
<br >
<br >class HomePage_Controller extends Page_Controller {
<br >}
<br >?>
<br >
<br >and then you should make new layout for your HomePage, it should be HomePage.ss inside your Layout folder:
<br ><br ><div class="typography">
<br > <h2>$Title</h2>
<br >
<br > $Widget
<br >
<br > $Content
<br > $Form
<br > $PageComments
<br ></div>
<br >
<br >
<br >Hope it will help. -
Re: Help for widget open in new page

2 June 2009 at 5:10pm
hi
many thanks for your reply.
I widget i passed the query string like still i cant able to view in new page..
Please tell me how to pass the query string in the widget.
http://localhost/pro/Projects/mywid/Story?id=2&action_results=Story
Like this i pass the widget query string
<% if MyStory %>
<% control MyStory %> $Link
<a href="Story?id=$ID&action_results=Story">$Desc</a><br>
(Please tell me how to pass the widget query string)
<% end_control %>
<% end_if %>THis is my NewStoryWidgetHolder page,
<?php
/**NewStoryWidgetHolder
* Defines the ArticlePage page type
*/class NewStoryWidgetHolder extends Page {
static $db = array(
);
static $has_one = array(
"Widget" => "WidgetArea",
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Widgets", new WidgetAreaEditor("Widget"));
return $fields;
}}
class NewStoryWidgetHolder_Controller extends Page_Controller {
function Story()
{
return 'srg';
}
}?>
Once again thanks
| 1235 Views | ||
|
Page:
1
|
Go to Top |


