Jump to content

Tyssen

Members
  • Posts

    353
  • Joined

  • Last visited

Everything posted by Tyssen

  1. Is there a way to output a nicely formatted author name using just the page's author without creating an additional author field attached to a template? At the moment I'm doing: $author = $page->createdUser; echo $author->name; but that just outputs admin when I'd like it to output Site Admin. But usernames can't contain spaces and there's no screen name field. So do I need to create a field for the news template for author? Or is there some other workaround?
  2. The pages are set up like: General Courses - Course 1 - Course 2 - Course 3 On the site, only a page for General Courses exists, all the individual courses are listed on that page, they don't have their own unique page that you can visit.
  3. I'm using the following search template: <?php /** * Search template * */ $outMain = ''; if($q = $sanitizer->selectorValue($input->get->q)) { $input->whitelist('q', $q); $matches = $pages->find("title|body|sidebar~=$q, limit=50"); $count = count($matches); if($count) { $outMain .= "<h1>Search results</h1> <p><strong>Found $count pages matching your query:</strong></p>" . "<ul class=\"nb\">"; foreach($matches as $m) { $outMain .= "<li> <h2 class=\"h4\"><a href='{$m->url}'>{$m->title}</a></h2> </li>"; } $outMain .= "</ul>"; } else { $outMain .= "<h2>Sorry, no results were found.</h2>"; } } else { $outMain .= "<p>Please enter a search term in the search box (upper right corner)</p>"; } include("./main.inc.php"); That works fine for pages that have their own URL but I have a bunch of child pages that don't have their own URLs, they're part of the parent page. How do I modify the code above so that the search result links to the parent page when the entry has no URL of its own?
  4. Thanks guys, I'll check those out.
  5. Martijn, thanks for your input, but the fact that I don't fully understand your reply is why I decided to post this as a job. I think it will get the job done quicker if someone does it for me, or at least creates the template from which I can then do the rest.
  6. Oh yeah, forgot that. So what I said in the other thread was I need to put together an online course using Processwire. The course contains 140 questions. With that many questions, it's going to need to be split up over a few pages and with the ability for someone to save their responses and maybe return later to complete so they don't have to do it all in one go. I've done something similar using ExpressionEngine before where a user would create a member account which would then enable them to create channel entries (essentially pages) from the front end. You'd create different templates/pages to hold different fields/questions related to their entry and they could come back, log in, and pick up their entry from where they left off last time.
  7. I started this discussion here, but realistically I'm not going to have the time (or skills probably ) to be able to do this myself, so was wondering if there may be any one who'd be able to give me an estimate to do something like this? Please ask for further details here or contact me via my website if you're able to help.
  8. I wouldn't mind taking a look at that if the offer is still on the table.
  9. This site is running 2.2.9.2 and the SessionHandlerDB module's not there. As the site is working OK with the session.save_path line commented out in index.php, I've been told to not bother with any more changes, but just wanted to check if there would be any adverse effects further down the line with that change in place. If not, then happy to leave it as is.
  10. NetRegistry, an Australian company. Been having trouble with them lately with other clients whose sites have been migrated without notice. In one case, had to move the site to a completely different host altogether. Don't have that option here as I don't have direct contact with the client.
  11. According to the web hosting company, they resolved the issue by commenting out #ini_set("session.save_path", rtrim($config->paths->sessions, '/')); in index.php. Is that likely to have consequences elsewhere though?
  12. I site I did a while ago has suddenly stopped working. I'm guessing a change on the server but the error message I'm getting when trying to access the site with debugging turned on is: The site is running on a LiteSpeed server with PHP 5.4.16. I've checked the db settings and they're correct.
  13. I've installed this module on sites before and not had any trouble, but just went to add it to a site on a server running PHP 5.2.17 and it brought the whole site down, so I quickly removed it again and the site came back up.
  14. This thread is a couple months old now so just wondering what the status of your module is Pete as I've just had an enquiry for booking paintballing sessions come up.
  15. The template that is adding the class to the body is a template that's included at the end of the template where the login form code is, i.e. it's a global framework template with the individual template passing various content variables in to different parts of the page. Would that cause the problem you're describing?
  16. Yeah, that works, no more errors, thanks.
  17. I've got this in my template: <body class="<?php if($page->parent) echo $page->name; if($user->isLoggedin()) echo ' logged-in' ?>"> That works fine when you're logged out and also when you've entered the correct password, but if you enter the wrong password, I get an error: and template won't render past that point. I know I could swap around so that I have a logged-out class only when logged out which would probably avoid the problem, but I've already written a lot of CSS for the other way around, so would like to avoid that. Is there anything else I can do to start the template failing with a wrong password?
  18. Where should I send messages for Form Builder support? I've got an issue when trying to send duplicate copies to another URL.
  19. Yeah, Ryan pointed that out to me on Twitter but with that in place, what's happening is that entries that don't have images pick up the image from the previous entry that does have an image.
  20. Originally I had: $outMain .= '<ul class="nb staff">'; foreach($page->children as $staff) : $outMain .= '<li> <h2 class="h3">'.$staff->title.'</h2> <p class="location">'.$staff->position.'</p>' .$staff->body.' </li>'; endforeach; $outMain .= '</ul>'; and that was working fine, but when I add in some code to show images if they're present: $outMain .= '<ul class="nb staff">'; foreach($page->children as $staff) : $image = $staff->images->first(); if(!$image) continue; $thumb = $image->size(140, 190); $outMain .= '<li> <h2 class="h3">'; if($thumb) $outMain .= '<img src="'.$thumb->url.'" alt="" class="img-r bdr">'; $outMain .= $staff->title.'</h2> <p class="location">'.$staff->position.'</p>' .$staff->body.' </li>'; endforeach; $outMain .= '</ul>'; now, only the pages/entries with images are shown. If I comment out the image stuff, all the entries display. What am I doing wrong?
  21. That'd be a bit beyond me I'm afraid.
  22. That only works from within the WYSIWYG though right? Doesn't work if you want to add an image with the standard images field.
  23. Wouldn't Processwire benefit from having some sort of global file/image management module so that you could choose assets for any page from a single location, rather than being specific to a page? I'm working a site where the client has decided to use the same content image on more than one page. At the moment, it seems the only acceptable option would be to upload the same image more than once. Creating related pages just to be able to add the same image to more than one page seems overkill for this scenario. On another site, the client wants to add images to the WYSIWYG field but first they have to add them to the page using the Images field on the page. It would be good if you could add images to a file module directly from within the WYSIWYG, because that two-step disjointed process is confusing for some people. A lot of other CMS have global file managers/media libraries, so just wondering why that feature is missing from Processwire?
×
×
  • Create New...