Well,

I still have the problem. I updated now to 2.0.1 and still not working.
Could it be a configuration issue?

Here's what I do:

public class ContainerPage extends Page {
   public Panel panel = new Panel('mypanel', '/myPanel.htm');
}

public class MyPanel extends Page {
   public String myString = "loaded and parsed inside panel";
}

ContainerPage.htm
<html> .... $mypanel ...</html>

myPanel.htm:
$myString

If I load the page directly: /myPanel.htm, it works.

It must be so simple yet not working. Am I missing somthing?




florin.g wrote:
> 
> Great, great. You are so helpful always!
> 
> I was just so puzzled as to why the same thing happens once but not the
> other. I will look into it further.
> 
> The panels are what I'm looking for. Both template and backing code.
> Wonderful.
> 
> Where do I send a pizza? I mean it. I'm not a programmer really, just a as
> a hubby, but is there anything I can help with?
> 
> 
> sabob wrote:
>> 
>> Hi Florin,
>> 
>> florin.g wrote:
>>> 
>>> I'd like to include a page fragment using the velocity #parse()
>>> directive.
>>> So, I got my Page ready, my template page as well, and it works. 
>>> 
>>> Then, I do a second one and it does not. If I load the fragment in the
>>> browser it does work, /mypage.htm. Included via the #parse() method, it
>>> does
>>> not. The debug logging does not show that the page is rendered, and the
>>> $variables are not parsed, but displayed as simple text. 
>> 
>> 
>> Do you mean you want to nest Pages or just templates?
>> 
>> If you mean Pages that won't work because Velocity #parse includes the 
>> specified template only. The associated Page object is not processed 
>> by Velocity.
>> 
>> If you mean nested template fragments that should work e.g.:
>> 
>> public MyPage extends Page {
>>      public MyPage() {
>>          addModel("fragment1", "/fragment/frag1.htm");
>>          addModel("fragment2", "/fragment/frag2.htm");
>>      }
>> }
>> 
>> 
>> /mypage.htm
>>    ...
>>    #parse($fragment1)
>> 
>> /fragment/frag1.htm
>>    ...
>>    #parse($fragment2);
>> 
>> 
>> Thing is you will have to specify all fragment variables inside your 
>> MyPage class.
>> 
>> However I think what you are looking for is Panels.
>> 
>> 
>>> 
>>> On the other hand, I need more than the BorderPage idea. What I want is
>>> the
>>> ability to make "components", or "portlets" that can be included in
>>> various
>>> pages. For instance, I have a "user list" in at least three different
>>> pages
>>> for different audiences and I want to reduce the amount of coding and
>>> refactoring.
>> 
>> 
>> Yeah sounds like a job for Panels. Panels are like mini pages in that 
>> they have their own template and model. You can easily nest and reuse 
>> panels between Pages as well. Since Panel is just a regular Container 
>> you can add Controls to it as well.
>> 
>> Hope this helps.
>> 
>> kind regards
>> 
>> bob
>> 
>> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Unexpected--parse%28%29-behavior-tp2470163p2471598.html
Sent from the click-user mailing list archive at Nabble.com.

Reply via email to