I'm trying to publish newsletters online (I create all the newsletters using Newsletter module)
1. I added additional field called "Publish_Online" to the NewsletterType.php and Newsletter.php
2. I created new page types called NewsletterHolder and NewsletterPage.
3. In the NewsletterHolder I included a function:
public function NewsletterTypes() {
return DataObject::get("NewsletterType","");
}
to get all the data from the table NewsletterType from db.
In the NewsletterHolder template I have this code:
<% if NewsletterTypes %>
<% control NewsletterTypes %>
<% if Publish_Online="true" %>
<% if DraftNewsletters %>
<% control DraftNewsletters %>
<% if Publish_Online="true" %>
<p>$Title<br>Date: $Created<br><a href="$baseURL/newsletter/?id={$ID}">Read</a></p>
<% end_if %>
<% end_control %>
<% end_if %>
<% if SentNewsletters %>
<% control SentNewsletters %>
<% if Publish_Online="true" %>
<p>$Title<br>Date: $Created<br><a href="$baseURL/newsletter/?id={$ID}">Read</a></p>
<% end_if %>
<% end_control %>
<% end_if %>
<% end_if %>
<% end_control %>
<% end_if %>
4. Now when I click on the link <a href="$baseURL/newsletter/?id={$ID}">Read</a> a go to the page (with type "NewsletterPage").
And I need to read this parameter id={$ID}? How to do that?
Or there are other ways to pass parameters between pages?