Jump to content

Tyssen

Members
  • Posts

    354
  • Joined

  • Last visited

Everything posted by Tyssen

  1. For instance I've got something like this: $outMain .= sponsor_row('Major Club Partners'); // $outMain is output in the global embedded template and the function that outputs the data: function sponsor_row($group) { foreach(wire('page')->sponsors as $sponsor) { if ($sponsor->sponsor_group->title == $group) { $output .= … } } return $output; }
  2. I also have some pages where I'm using functions and calling wire('page'). How do I update that to use the ID of the included page?
  3. I'm giving this a go and it seems to work fine for first level pages, but for second level pages I get the page title but not the rest of the content.
  4. The only problem there is they also have an ever expanding news section that they also want to duplicate so that would mean having to do this for a lot of pages.
  5. So if I have: Home - About - Subsite home do you mean to include a page entry for About under Subsite home which then includes the main site's About page with the includePage fieldtype?
  6. Actually, maybe not so much. I have, for example, /about/ on the main site and I want to display the same page on the subsite. If I visit /subsite/about/ I get a 404. Also, I've created a new template for the subsite home page which includes to a new global template (for different branding, navigation), but if I can get the same pages to show up on both main and subsites, how do I get the pages on the subsite to use the subsite global template instead of the of the main site?
  7. Thanks, that's got me going in the right direction.
  8. I need to create an offshoot site that shares some, but not all of the pages of the parent site. Is there any way to show pages from the parent site on subsite or do they have to be duplicated and made children of the subsite's home page?
  9. When trying to create a backup from within the CP, I get: Is this to do with: because I'm not sure I have the ability to do anything about that on the host I'm testing it out on.
  10. I'm getting reports from a client that PCs running IE8 & 10 on an internal network with ChromeFrame plugin installed won't stay logged in to a site that is set up with all the content behind a login form, i.e. on the front-end, not logging into the control panel. Disabling the plugin in the browser makes the problem go away. So does updating .htacess from <IfModule mod_headers.c> Header set X-UA-Compatible "IE=edge,chrome=1" <FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webm|webp|woff|xml|xpi)$"> Header unset X-UA-Compatible </FilesMatch> </IfModule> to <IfModule mod_headers.c> Header unset X-UA-Compatible </IfModule> This seems to have solved the issue but I thought it was worth mentioning here anyway.
  11. That sounds fine Ryan. Preventing determined people from liking content over and over isn't really an issue for the site in question.
  12. The way you can like entries in the PW sites directory is pretty much the way I want it to work, so ideally, would like to find out how that's done. Ryan?
  13. I actually need it for guests (not logged in) to be able to like content.
  14. Hi Ryan, would you be able to follow up with the info about the sites directory and liking that you mentioned above?
  15. Ah, right, I was making things far more complex than they needed to be. That works fine, thanks.
  16. $entry->title outputs Row 1 which is the name of the layout entry, rather than the title of the image entry. I'm trying to give the site owner a way of grouping groups of images (each which is a link to a modal which then contains a full gallery of images). Sometimes they want a single image full width, sometimes they want a tall image left with two smaller images right, and sometimes the opposite. So my idea was they create a series of image entries which each have a title where they can upload all the images, and they can also add tags too. Then there's the layout entries which has four page select fields: one for choosing a single full width image entry, one for choosing a single tall, left-aligned image entry, one for choosing a single tall, right-aligned image entry, and one for choosing two smaller image entries. So the template loops through all the layout entries and outputs a wrapping div for each one. I then want to output the data from the pages that are selected with the page select fields within each entry. Does that make more sense?
  17. $entries = $pages->find('parent=/layouts');
  18. I'm working on a site where a photographer creates a series of image entries and then uses another 'layout' entry to group images for presentation. So in the layout entry, there's fields for full width image, image left, image right, smaller images etc and the photographer can select image entries. In my template I have: foreach($entries as $entry) : if($entry->image_full) : $outMain .= '<div class="full">'; $full = $pages->get($entry->image_full); $outMain .= $full->title; $outMain .= '</div>'; endif; endforeach; This outputs the wrapping div but not any of the contents. If I replace $full = $pages->get($entry->image_full) with an actual entry ID it works. So how do I select the page based on the value of the page fieldtype? :?
  19. Yeah, the likes in the site directory.
  20. Looks like the social media requirement has been shelved, so if you have time to explain a little about how you implemented your liking system André, that'd be great.
  21. Yeah, that'd be great if you could. But before going there, I guess I need to determine whether PW is the right fit for this job and there's another requirement that's come up which I'm unsure about. As well as liking pages/entries, there's a requirement that individual images can also be shared on social networks, but each image should have its own page (other than just a URL to the image itself) so something like domain.com/image/entry_id/image_id/ and then the image template would know to find an entry ID from segment 2 of the URL and image based on the value of segment 3. As files don't actually have IDs in PW, not sure if that's possible.
  22. Are there any modules for Processwire which allow site visitors to 'like' pages or content? And unrelated but for the same site I'm building, I need to be able to output entries/pages in different layouts on the front end. It's for a photographer's site with photos (each linking to a gallery so each would be a page or entry) and the layout calls for photos to be displayed in three different layout formats: full width image half width image floated left with two other half width images equal to half the height of the left floated image same layout as above but with the larger image floated right So other than the full width images, other entries have to be in groups of three (one larger image left or right next to two smaller ones). If it was always going to be in the same sequence, then it would be no problem, but the site author needs to be able to control the presentation. Any idea how to approach it?
  23. Hi Nico, what do you with the output of the parser?
  24. I have this in my template: function sponsor_row($group) { $output = 'test'; foreach($page->sponsors as $sponsor) : // if ($sponsor->sponsor_group->title == $group) : $output .= '<li> <a href="#"> <img src="'. $sponsor->sponsor_logo->url .'" alt=""> '. $sponsor->sponsor_title .' </a> </li>'; // endif; endforeach; return $output; } $outMain = sponsor_row(); What's getting printed out is 'test' and not the contents of the $output variable further down. I've verified the the foreach loop does output data (and in fact if I just type a string out for $output in the loop it still produces the same result), so why is only the first instance of $output being output?
×
×
  • Create New...