Jump to content

gnome

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by gnome

  1. Thank-you Soma! For mentioning the "navigation" field. It turns out that this is used to generate the menu, rather than just getting the page children. So you have to manually add the new page(s) to the navigation field for it to appear in the menu. Thank-you to all for your help and suggestions.
  2. Definitely on the right domain. I've taken a screen grab. This is what ProcessWire says: And this is what the code above outputs:
  3. Hi all I've been using ProcessWire for a while and am completely comfortable using it. BUT, for some reason, today I am unable to echo out a page link! I have a section (About Us), which did have 4 children. Today I have added a 5th child page, but it refuses to be added to the navigation. I've echoed out the count of children and it is coming back as 4, even though there are now 5. The page is published and saves fine. I've deleted it and re-added it, to no avail. Has anyone else ever had this issue? Any suggestions more than welcome! Code for generating menu is below. $navigation = $page->rootParent->navigation; if(count($navigation) > 0) { //echo count($navigation); foreach($navigation as $p) { $children = $p->children; //echo $p->url; //echo count($children); // count children (exclude certain templates) if(count($children) && $p->is("template!=news-page|team-page|development-land-page|sheep-sales-page|produce-sales-page|grass-keep-page|property-list-page|property-auctions-page")) { // accordion header ?> <a href="#" class="submenu<?php if($page->parents->has($p) || $p === $page) echo '-current'; ?>"><?= $p->title; ?></a> <?php // expandable sub-menu ?> <div class="sub-sub-links <?php if($page->parents->has($p) || $p === $page) echo 'active'; ?>"> <?php foreach($children as $child) { ?> <a href="<?= $child->url; ?>" <?php if($child === $page) echo 'class="sub-sub-links-current"'; ?>><?= $child->title; ?></a> <?php } ?> </div> <?php } else { // single page if ($page->parents->has($p) || $p === $page) { $class = 'sub-links-current'; } else { $class = ''; } ?> <a href="<?= $p->url; ?>" class="<?= $class; ?>"><?= $p->title; ?></a> <?php } }
  4. Hi I need to have a search form linked to my news articles. The fields I need are shown in the attachment Is this possible in processwire? Could someone give me pointers on how to go about this? Many thanks!
  5. I am using $parents = $page->parents; foreach($parents as $parent) { [indent=1]// do llinks[/indent] } to show breadcrumb links. The problem I have is that sometimes the parent page is a section rather than a page with content. For example, I have a section called About Us which contains various pages, but About Us is not a page itself. I could create an About Us page and have a meta refresh in it to go to the first page of that section, but is there a better way? Thanks!
  6. I think this $highlights = $pages->find("template=template-news, sort=-newsDate, highlight=1, limit=5"); is what I need. Thanks to all!
  7. I have a news articles list displayed: $articles = $pages->find("template=template-news, sort=-newsDate, limit=5"); Now I need to have a new page which shows some (but not all) of the news articles. What would be the best/easiest way to achieve this? Thanks!
  8. Thanks onjegolders, this sounds great. Will give it a go!
  9. Hi onjegolders It would be the simple version - a page where you display all your files under their respective heading (Brochures, Instructions)
  10. Thanks diogo. I think maybe I've confused things. What I'm trying to achieve is a page where I can add PDFs to a page. Each PDF would belong to a category. Then I would loop through and show Category Name PDF 1 PDF 2 PDF 3 Is this possible? Thanks!
  11. Hi I've just found the related pages tutorial: http://processwire.com/videos/page-fieldtype/ Is it possible to do something similar, but rather than choose pages, to choose files? Thanks!
  12. apeisa, thanks. I've tried what they suggest - still not able to upload a 25MB PDF!
  13. Hi I'm having trouble adding PDFs to my page. They are large files - up to 50Mb. They appear to be failing - the progress bar gets stuck on 99%. I have tried adding upload_max_filesize = 100M post_max_size = 100M to php.ini, but no luck. Has anyone else had this and found a solution? Thanks!
  14. I will check out the cheatsheet. Your code example is cleaner. I will copy this style from now on. Thanks again.
  15. Okay, I got it. So now I have if(file_exists($latestNewsletter->filename)) { ?><a href="<?= $latestNewsletter->url; ?>">text</a><?php } Thanks for the help
  16. $page->latestNewsletter latestNewsletter is a file field.
  17. Thanks, but if I echo $latestNewsletter->path I get nothing.
  18. Hi I am using file_exists to see if a PDF file exists on the server: if(file_exists($latestNewsletter->url)) { // link to pdf } but this is returning false. The file definitely exists. If I change to !file_exists, the link is shown and links to the PDF correctly. Does anyone know why this is happening?
  19. Thanks apeisa, that was it. I resaved and now my PDF document is added.
  20. Yes, pdf is in there. The error message says 'pdf is a invalid file extension. Please use one of:', but nothing after that.
  21. arjen, apeisa - thank-you. I have used a repeater field and it's just what I need. One problem I have though - I've defined a 'file' field as part of my repeater, but when I try to add a PDF document it says that .pdf is not a valid file extension. Is it not possible to have PDF or do I need a different field type?
  22. Hi all I am very new to ProcessWire, but have managed to create a content managed site in super quick time! I currently have 2 templates, home and content - that's all I've needed! But now I need to add a new column on the right of my pages that will hold a list of PDF downloads. The list of downloads will be different on each page - some will have a few, some will have none. Each item in the list needs a name, thumbnail image, and document to link to. I was tempted to create a new template for each, but I don't think that's the way to go. Would I do this like a list of news articles? But then I don't know how to specify which 'articles' appear on which page? Any pointers would be greatly appreciated!
×
×
  • Create New...