plainblack.com
Username Password
search
Bookmark and Share

NewOnSite Macro

The NewOnSite macro can be used to create an overview of the newest content on your website. As it uses WebGUI's templating mechanism, you have complete control over the layout. The number of wobjects shown is configurable and only active content that the current user is allowed to view is displayed.

Information about installation and usage of the macro can be found in the info.txt file, which is included in the zipfile. If you have any questions, suggestions, bug reports or improvements, use the discussion system of this submission. You can also reach me by email on the address webmaster@chipencharge.nl.

Happy New Year to the WebGUI-community and PlainBlack!

System RequirementsPlease be advised: this contribution was tested with something older than WebGUI 7.5. When this contribution was uploaded there was no field for the author to fill out regarding it's requirements.
Comments
4fishingfan: "
Hi

I like the macro and am in process of adding to the site. 

One thing I'm not clear on is how to use the hidefromNavigation variable. 

I want the pages that are currently hidden from the users (via the hide page) not to show in the latest added list, so they don't click on and see work in progress that is not complete.  Is this possible with your macro ?

Chris

 
"
4Woutje: "Thanks for the compliment! Could you mail me a link to it if you're done (just curious to see what people do with it)?

I want the pages that are currently hidden from the users (via the hide page) not to show in the latest added list, so they don't click on and see work in progress that is not complete.  Is this possible with your macro?

Yes, that's the reason I put it in there. You can use it like this (in the wobject_loop):
<TMPL_IF hideFromNavigation>
This item is hided!
<TMPL_ELSE>
This item isn't!
</TMPL_IF>

Or like this if you don't want anything to show up for the hided pages:
<TMPL_LOOP wobject_loop>
<TMPL_UNLESS hideFromNavigation>
 Template code to create the links.
</TMPL_UNLESS>
</TMPL_LOOP>"
4fishingfan: "
Thanks Woutje,

I'm currently testing it on a local machine, i'll mail you when I add it to the site.  I'm going to definitely use this macro, it is something I was needing, I had tried the SQL code in the ruling webgui docs a while back but could never get it to work.

One thing to note is that if you use the hidden bit in the template and you specify 5 links to be returned and one is hidden you only get 4 links displayed.  (Which is what I expected it to do).

Chris
"
2Woutje: "One thing to note is that if you use the hidden bit in the template and you specify 5 links to be returned and one is hidden you only get 4 links displayed.  (Which is what I expected it to do).

You're right. As I don't use this myself (I never needed the hideFromNavigation as I use the privilege-system to hide pages people aren't supposed to see), I hadn't thought of it. Because the Template engine (intentionally) has limited control flow abilities, I think the only solution is adding a parameter with which you can specify whether hided pages should be included or not. Do you think that would be better and/or"
4fishingfan: "
As I don't use this myself (I never needed the hideFromNavigation as I use the privilege-system to hide pages people aren't supposed to see), I hadn't thought of it.

Does that stop the those pages from showing in the list generated though ? 

 I think the only solution is adding a parameter with which you can specify whether hided pages should be included or not. Do you think that would be better and/or necessary?

I'm not sure it is necessary, although it would be nice to have.  I was getting round it by just slightly altering the code in your macro.  As below (I added the red bits).

if ($data->{hideFromNavigation} == 0) {          
      push(@wobject_loop, $data);
      $row++;
      last if $row == $numResults;
}

"
4fishingfan: "
Ah no colour highlights when posted .

I added the first and last line.
"
4Woutje: "Does that stop the those pages from showing in the list generated though ?
Yes, that what the line
next unless ( WebGUI::Privilege::canViewWobject($data->{'wobjectId'})
&& WebGUI::Privilege::canViewPage($data->{'pageId'}) );
is for. Your change works fine of course, but you could also do

next unless ( WebGUI::Privilege::canViewWobject($data->{'wobjectId'})
&& WebGUI::Privilege::canViewPage($data->{'pageId'})    && $data->{hideFromNavigation} == 0);
for a (small! :)) performance"
4fishingfan: "
Thanks I'd missed that, should have looked at it a bit longer.

 
"
4baylink: "but does it also correctly drop objects the user hasn't *permission* to"
4Woutje: "Yes, it does. At least, it's supposed to do it. Your question seems to imply that you have had some sort of problem with it. Is that the case or am I misreading"
4baylink: "Nope, not yet.  Wuz just wonderin.  :-)

Want to use it, needed to make sure.  Figured it'd be easier to"
4fishingfan: "
Hi Woutje

Just to say I'm using your macro on my site.

I've aptly entitled it New on Site!

Thanks Chris


"
4Jeremy Sneeden: "
I am trying to create a template to use your wobject.  I would like to just have the title the owner and the type.  I cannot seem to get this to work.  Could you possibly show me how to do this?  I am a newbie when it comes to templates.

 

Jeremy

 
"
2Jeremy Sneeden: "
I found the default template and used that.  We are using your macro at www.pillager.k12.mn.us/Whats_new.  It seems to work great thanks.

 

Jeremy

 
"
DownloadNewOnSite-1.0.0.zip NewOnSite-1.0.0.zip
LinksNo Support Offered
Statistics Downloads: 378
Views: 13012
Rating: 4
Updated: 8/12/2005
Keywords macros
NavigationBack to the Bazaar
© 2018 Plain Black Corporation | All Rights Reserved