Jump to content

ridgedale

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by ridgedale

  1. Reference: PW 3.0.62 and uikit3 based site using the Regular-Master profile. I've setup a hidden page and template (sitePreferences - with no associated template file) containing site-wide preferences/settings, however I can't get the field content to display. I've tried the following which either display nothing or break the site: <?php echo $item->siteChairperson; ?> <-- nothing gets displayed <?php echo $field->siteChairperson; ?> <-- nothing gets displayed <?php =page()->siteChairperson ?> <-- breaks site <?php echo $field = $fields->get('siteChairperson'); ?> <-- displays the text siteChairperson instead of the name. <?php =sitePreferences()->siteChairperson?> <-- breaks site <?php echo $field->get($siteChairperson); ?> <-- breaks site Any assistance would be greatly appreciated.
  2. Reference: PW 3.0.62 and uikit3 based site using the Regular-Master profile. I wonder if anyone has come across the problem of displaying images within the <figure> element before. When editing a page: If an image is added inside <p></p> tags without any align assigned, it displays normally at the size the user has specified. See screen grab example 1. If an image is placed inside the <figure> element and left or right alignment applied, the size the image is displayed as in the editing view is significantly reduced. See screen grab example 2. If an image is placed inside the <figure> element and center alignment applied, the size the image completely disappears in the editing view with only the caption text showing. See screen grab example 3. The code used to display an image in <p></p> tags without aligment assigned is standard: <p><img alt="" src="/<path-to-image>/image.jpg" width="128" /></p> Examples of the code automatically being generated by PW3/UiKit3 from within the image editing interface are: <figure class="align_left"><img alt="" src="/<path-to-image>/image.jpg>" width="128" /> <figcaption>Caption text</figcaption> </figure> <figure class="align_right"><img alt="" src="/<path-to-image>/image.jpg>" width="128" /> <figcaption>Caption text</figcaption> </figure> <figure class="align_center"><img alt="" src="/<path-to-image>/image.jpg>" width="128" /> <figcaption>Caption text</figcaption> </figure> Important Note: The images and and captions actually do display correctly when the website is browsed, but from the editing perspective it is not practical. Any thoughts or advice would be appreciated.
  3. Hi abdus, Thank you for your reply and . Could you describe how your upload process works from a registered user's perspective when editing a given page? I realise also there is a possible solution staring me in the face as I write this reply. Do you or does anyone else know how the Insert other media button/panel is implemented?
  4. I've been trying to work out how I can provide a frontend file upload (whatever file format the user chooses to upload - albeit not executables!) for registered users to be able to create pages/posts and upload any file they wish so they can create a link to the file so it can either be downloaded or displayed. Everything I've read so far appears to relate to just images and uploading and adding images is already covered using the images field. Any thoughts/guidance would be a appreciated.
  5. Hi Bernhard, Apologies, I forgot to answer your question. PW3 has built-in debugging by editing the /site/config.php file: changing the folloing line: $config->debug = false; to: $config->debug = true; That is what I have been using. It is very possible that TracyDebugger may provide more detailed and clearer debugging information as you have indicated. That is something I will have to learn. Thanks again for all your help.
  6. Hi Bernard, Thanks for all your input. I clearly need to to do a lot of reading before I implement TracyDebugger. Plus I the feedback you have provided shows I need to read all the comments in the base code. Apologies. In the end I've learned the screwed layout issue encountered using lokomotivan's code suggestion was caused by a missing </a>!! The final code to get the required data delivered needed no changes to the _uikit.php, just an edit of the sidebar code on the blog.php page. I replaced the following code: <?php $categories = pages()->get('/categories/'); echo ukNav($categories->children, [ 'header' => $categories->title ]); ?> with: <?php $categories = $pages->get('/categories/'); echo "<ul class='uk-nav uk-nav-default'>"; echo "<li class='uk-nav-header'>Categories</li>"; foreach($categories->children() as $category) { echo "<li class='uk-nav-divider'></li>"; echo "<li><a href='$category->url'>". $category->title . "<span class='uk-align-right'>" . $pages->find("categories=$category")->count . "</span></a></li>"; } echo "</ul>"; ?> Many thanks again to you all for all your advice and assistance.
  7. Hi Bernhard / BitPoet / lokomotivan, I'm using the built-in debugging for this setup. So I'm a bit wary about adding another module that might conflict. I think the problem is that in this instance I'm trying to gather information from both UiKit3 and PW3 functions and they don't appear to be passing variables between them. That's my guess as I am no expert. What I can see is that the ukNav function (_uikit.php) variable $item is generating the ids of the categories (which I can output replacing: $out .= "<a href='$item->url'>$item->title <span class='uk-align-right'>" . $item->children->count() . "</span></a>"; with: $out .= "<a href='$item->url'>$item->title <span class='uk-align-right'>" . $item . "</span></a>"; and also from $item the category title is generated and output. Another _uikit.php function ukBlogPosts should be able to generate the total number of blog posts. But when I call it using count(ukBlogPosts($posts)) the output is 1, so either I have misunderstood or I am not using the correct code to retrieve the required information. The only thing I can think of at this stage is to try to retrieve a count of all the pages where the parent ID matches $item. It would appear I need to reference some, if not all, of the ukBlogPosts function, but all attempts so far have failed to generate the correct output. Any more thoughts would be very welcome. Thanks for all your patience.
  8. Hi Bernhard / BitPoet / lokomotivan, Thanks again for all your feedback. I tried BitPoet's amended code which allows the site styling to remain unchanged: $out .= "<a href='$item->url'>$item->title <span class='uk-align-right'>" . $item->children->count() . "</span></a>"; In order to prevent all navigation elements displaying the count output I duplicated and renamed the ukNav function, added the renamed function to the end of the _uikit.php file and called the renamed function with the updated code. However all the post count values are returned as zero. See attached screen grab: SidebarOutput01.png. I also tried lokomotivan's suggestion with the corrected php code, leaving the _uikit.php untouched: $categories = $pages->get('/categories/'); echo "<ul class='uk-nav uk-nav-default'>"; foreach($categories->children() as $cat) { echo "<li><a href='$cat->url'>". $cat->title . $pages->find("categories=$cat")->count . "</li>"; } echo "</ul>"; lokomotivan's code does actually return the correct category count values, as far as I can tell. However, because the output is not being generated via/through the ukNav function it messes up the site layout. See attached screen grab: SidebarOutput02.png. I tried integrating lokomotivan's code into the renamed ukNav function by adding the following variable declarations after immediately line 102 (original ukNav function line numbering): $categories = $items->get('/categories/'); $cat = $categories->children(); and replacing the original line 153 of the _uikit.php file with: $out .= "<a href='$item->url'>$item->title <span class='uk-align-right'>" . $pages->find("categories=$cat")->count . "</span></a>"; Then tried calling the renamed function, but get the following error: The renamed function is baulking at the following variable declaration that I added: $cat = $categories->children(); Almost certainly the code I've used is incorrect/invalid. Any ideas where I am going wrong?
  9. It looks like it doesn't like the $cat reference in: $pages->find('categories=$cat') Again I must be doing something wrong. Any ideas where I am going wrong?
  10. Hi BitPoet, I backed up the _uikit.php file and replaced line 153 with the following: $out .= "<a href='$item->url'>$item->title</a> <span class=''>$item->children->count()</span>"; but that simply outputs: count(), not the number of category posts. I must be doing something wrong. Any ideas?
  11. Hi BitPoet/lokomotivan, Thank you for the suggestions. I'll let you know how I get on. Thanks again.
  12. Thanks for the confirmation, Erik. Much apprciated.
  13. Could anyone confirm whether or not they have this module working in PW3.0.62?
  14. Reference: PW 3.0.62 and uikit3 based site using the Reglar-Master profile. I'm trying to add a count of the number of category posts to display beside each of the category titles listed in the sidebar on the blog page. The following code displays the total number posts on each category page: <span class='uk-text-muted'>Total <?php echo page()->title; ?> posts: <?php echo count(pages()->get('/blog/')->children("categories=$page")); ?></span> The following default code displays the heading and a list of the categories: <?php $categories = pages()->get('/categories/'); echo ukNav($categories->children, [ 'header' => $categories->title ]); ?> but I want to add the respective number of posts on the same line as each category title listed. When I try replacing the default code with the following: <?php $categories = pages()->get('/categories/'); $catposts = count($categories->children("categories=$page")); echo ukNav($categories->children . ' ' . $catposts, [ 'header' => $categories->title ]); ?> I get the following error: which refers to the following code in the _uikit.php file: $page = $items->wire('page'); // current page and when I try: <?php $categories = pages()->get('/categories/'); $catposts = count($categories->children("categories=$page")); echo ukNav($categories->title); foreach ($categories as $category) { echo $category->children . ' ' . $catposts; } ?> or: <?php $categories = pages()->get('/categories/'); $catposts = count(pages()->get('/blog/')->children("categories=$page")); echo ukNav($categories->title); foreach ($categories as $category) { echo $category->children . ' ' . $catposts; } ?> I get the same error. If I change to I get the following error messages: Any advice on where I am going wrong would be very much appreciated.
  15. Hi rafaoski, Thanks for that. I'll remember to check the uikit docs in future. Much appreciated.
  16. I'm in the process of finalising a pw 3.0.62 and uikit3 based site which using the Reglar-Master profile and I've noticed pagination is missing despite the Allow Page Numbers? setting being enabled under the blog template URLs tab. The default blog.php template is as below: <div id='content'> <?php echo ukHeading1(page()->title, 'divider'); $posts = page()->children('limit=10'); echo ukBlogPosts($posts); ?> </div> Reducing the limit as follows does not result in any pagination being displayed despite there being 10 news posts. ... $posts = page()->children('limit=6'); ... If I have understood correctly, it should not be necessary to add the MarkupPagerNav module to this profile as the capability should already be already built-in. If that is the case, then I can only think that some additional code is required. Any help would be greatly appreciated.
  17. Thanks for the additional feeback, guys. Much appreciated.
  18. I'm using Processwire 3.0.61 with the site-regular profile and am in the process of browser/device testing for the template I'm working on. I've managed to get a consistent displaying of the site across Firefox, Google Chrome, Internet Explorer, Opera, Safari (both Windows and Mac checked but not Linux, yet) and Android (portrait orientation on SIII Mini). When I initially switch to landscape orientation on the SIII Mini the layout is consistently retained. I'm assuming that is because the device initially zooms the page rather than redraws the screen. However, as soon as I click on the menu icon the screen is redrawn in such a manner that the body of the template is offset by what looks like +10px or so (right and down) pushing the whole of the content off the screen to the right as well as down. Interestingly the shadow on the banner background image (set to fill width of screen using the cover attribute) remains in place where it should be. But there is also the wierd artifact that any horizontal rules appear twice (once where they should be and once offset again by what looks like the same amount as mentioned above). Nothing I've tried in terms of CSS3 has any effect so far. I'm wondering if anyone else has come across this issue. If so, could it be related to the UiKit3 css/js code? Any help would be appreciated.
  19. I was wondering if anyone has successfully integrated Securimage with Processwire 3. I've tried the suggested fixes posted here, but I haven't managed to get the captcha image to display. This might be because the instructions relate to Processwire version 2.x where I am working with version 3. Any ideas/steps what to do would be appreciated.
  20. Thanks for the explanation and link, fbg13. Much appreciated.
  21. I've encountered the same issue with the latest version of Securimage and PW 3.0.61. I have Securimage woking without any issue on most of my other non-cms websites. I've made the changes to the securimage.php as suggested by jamesmarshall. That has not worked. Are there other steps that need to be taken such as adding Would it be possible for someone to share the steps taken to get Securimage working? Any help would be appreciated.
  22. Update: The blog-post.php page rendering issue was resolved by removing the _header.php and _footer.php includes. Thanks again to Zeka for his initial assistance.
  23. Hi gunter, Simply adding: <?php namespace ProcessWire; ?> to the top of the _header.php page resolved the issue. Can you explain why and how your suggestion might have helped with an example?
  24. Update: I'm not sure why but the failure to render the page properly must have been due to an error in my code somewhere; pw-append works exactly as above with single quotes or double quotes.
  25. Hi Zeka, Thank you for your reply. That appears to be getting somewhere as some of the child pages are now displaying OK. However, the blog-post pages and now the contact page are generating the following same error: The line of code referred to is as follows: <?=ukNavbarNav($home->and($home->children), [ That code has not been modified from the site-regular profile. It's a bit odd as all the pages load that code and it now appears that just the blog-post and contact pages throw up that error message. Update: Adding the following line after namespace Processwire; code $home = pages()->get('/'); // homepage gets rid of the error message but the blog-post pages are still not rendering properly. The pages now appear to be rendering twice and all the margins are messed up. Any advice would be appreciated.
×
×
  • Create New...