Jump to content

MarcinP

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

1,322 profile views

MarcinP's Achievements

Newbie

Newbie (2/6)

4

Reputation

  1. There is new module for PW, that do exactly that what i needed - https://processwire.com/talk/topic/13381-templateschildpages/
  2. Hi, I would like add white text on image. Is there easy way to do that using this module? I know i can add watermark text but it has his own style. I need just white text with no style.
  3. Hi. I installed ShoppingCart module and i wanted to use PayPal payment. I installed module but i can't use it. I tried also on fresh installation of PW. Checkout works but PayPal payment dont work. Simple Invoice Payment works fine but PayPal payment dont even generate order. You can check it here: http://demo.webego.pl/pwshop/about/background/ Do you have any ideas what is going on? Thans in advance.
  4. Hi guys. I have very strange problem that i cant managed fo few hours. This is realy hard to understand for me. I work on website and i want it to have banners in few places. In admin i created structure: Banners > Banner Group > Banner 1, Banner2, Banner 3 etc. I want this banners to be loaded one by one rather than randomly. I created function that print baner and save its id to session variable like this: function renderBannerBox($banner_group = false) { //takes banner group name as argument $out = ''; if ($banner_group) { $bgroup_url = '/banners/' . $banner_group . '/'; $bgroup = wire(pages)->get($bgroup_url); if ($bgroup->id) { $bgroup_id = $bgroup->id; //for every banner group create separate session variable to store displayed banners $session_name = $bgroup->name . '_array'; //get session variable with array of ids of displayed banners $displayed_banners = wire(session)->$session_name; $selector = "id!="; $selector .= substr($displayed_banners, 0, -1); $selector .= ", template=banner, parent=$bgroup_id"; $banners = wire(pages)->find("template=banner, parent=$bgroup_id"); $banner = $banners->get($selector); //if no banner (first view or all banners from group displayed) get random banner and if (! $banner->id) { $displayed_banners = ''; // clear $displayed banners variable $banner = $banners->findRandom(1)->first; //get random banner } //add current banner id to variable $displayed_banners .= $banner->id . '|'; // save variable to $session wire(session)->$session_name = $displayed_banners; // code for html formating } } Strange thing is that for every page refresh different number of banners ids are saved to my $session variable. One time is 1 id, second time 2 ids and so on. You can see it here: http://demo.webego.pl/ginfo/ - above every banner i print current value of $session variable. I tested it also in my main template file with independent test variable - it works the same way. It looks like page is sometimes 'double loaded'. Please let me know if you have any idea what is going on.
  5. @Martijn Geerts: It is good solution for templates in context of HTML output. It will not work for templates considered as group of fields. @horst: Propably you are right but my idea is not to make better performane but 'ease of use'. Limiting teplates for pages could be more efficient for developers. I think it dont have to affect core and db.
  6. Hi. I wonder if is there possibility to limit page children to specific template. I know that it can be done in template settings. But I think it could be good option to do it in page settings. Lets say we have templates like news, gallery, author, tag, movie, song itc. We have also pages with the same names. If we want page 'Video' to accept children only with template 'video' we need to create template like 'videos-container' and set it to accept only children with template 'video'. And so on with other pages and teplates. It ends with many 'empty' templates which role is only limitation child templates in specific pages. If we could limit children templates in page settings it would be enough to have one template like 'common-container'. PS: sorry for my bad english.
  7. I will refresh this topic. I've made some modification in comments module and wrote some 'dirty code' - comment voting works. You can see it here http://demo.webego.pl/pw25/about/ Now I've got another question for you - what will be the best way to stop duplicate voting. Now i store voted comments ids in session variable - is it good or bad idea?
  8. Hi. I wonder if it is posible to add voting system to comments. Do you have any ideas how to do that?
×
×
  • Create New...