Jump to content

Peter Knight

Members
  • Posts

    1,377
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Peter Knight

  1. I don't have screengrabs right now but I was uploading several staff photos this evening. Has anyone experienced an issue whereby uploaded (drag and drop) images become desaturated slightly? It's quite subtle but noticeable enough when viewed side by side with original image.
  2. I like this approach. HannaCode is an integral part of most of my sites but I find it easier to upload chunks of code via my FTP editor. And by using a proper text editor, I have better syntax highlighting etc. I put them in a sub-folder just to keep them separate from main templates include($config->paths->templates.'/chunks/get-client-logos.php'); Only problem I have is ye olde recursive Body not working unless I manually update the Module.
  3. I think I had the same problem recently. I'll trawl through a project I had in progress and see how I solved it. You basically want to allow clients to apply a link to an image. The link around the image would direct front end users to an internal page. On the Admin side, you're using the pageselect field to achieve this. Any code examples and screenshots of the Admin for us?
  4. Hi guys I'm using Batcher to batch remove all pages that meet certain criteria template is news_item old_url doesn't contain "news/" I can do the opposite of the above and find all pages that do contain "/news/" template=news_item,old_url*=news/ There doesn't seem to be an API call for finding fields that do not contain or do not start with a string ? There's something close: != Not equal to (any_field!=any_value) which I use as follows template=news_item,old_url!=news/ but this doesn't work. It pulls in pages with and without my selector criteria and I'd probably prefer does not contain as opposed to not equal to Not posting this in the batcher forum as it's a general selector query. Any pointers grateful accepted
  5. Is the other domain for a business in the same industry? Just trying to establish if this is a genuine mistake. You could also consider that someone did a deliberate point to harm your rankings? Duplicate content etc?
  6. @Diogo Linode looks very interesting. I signed up for an account and setup a Linode just to test it. It looks like most of the server admin etc is done via SSH though? My own short coming but I prefer a GUI.
  7. Thanks @OrganizedFellow I'll check them out.
  8. Hi folks Anyone here using a VPS for their hosting and have positive experiences? Looking for for the following. * VPS hosting * UK or Europe based * SSD based * possibly managed Thanks
  9. Hi guys I have a Comments field that refuses to notify my client of new comments. Initially I had my own email address followed by a space and then his email. That worked (for me) and I successfully was notified of comments. The notification field now contains ONLY his email address . He assures me nothing is reaching him or his spam folder. I've also quadruple checked for typos. I'm wondering if this is happening because he is an editor and not an administrator? I'm also wondering if I should have WireSMTP or similar installed? I don't think it's this as I had been notified without any WireSMTP etc installed. I'm running 2.6.21 dev with the latest comments upgrade.
  10. If it's template files you want to edit directly within the Admin, there is a Module available http://modules.processwire.com/modules/template-editor/
  11. Cue lots of forums members checking their in-progress sites But seriously - Welcome to the forums and PW.
  12. I've a blog setup which contains tags and categories related to posts. Tags and categories are both Page fields with option to add new page(s) from their fields. If I create a new post I will usually create some new tags and cats and then save the post as unpublished while it goes to review. Unfortunately, although my post is unpublished, my tags and cat pages go live on the main blog immediately. So even though my post isn't published, we have a selection of tags and cats which users can click on. I guess my request is for some kind of in-built dependency engine here that would realise my main post isn't unpublished and therefore not publish the dependencies (cats and tag pages) related exclusively or created solely for this post.
  13. Thanks. I completely take your advice. At the moment I'm just showing some content for myself while I develop a new part of a page so this will work great.
  14. Thanks apesia. So simple! Now that I know where to look, I notice that here is a $user->name property. Can't I do this? if ($user->name("Peter")) { echo "Hidden content"; } or refer to a user by pageID if ($user->id("41")) { echo "Hidden content"; } I'm not at my installation right now.
  15. Hi guys I'm attempting to do something new (to me) in PW and a search is coming up blank. I suspect I'm using the wrong search terms. I'd like to create a simple content block that is only shown to distinct PW users. The overall page itself would be public and viewable by anyone but there's a particular DIV which only shows to PW user X or Y. Can someone point me in the right direction? I thought this would be session based but having searched the forums and Google I'm coming up with results on hiding back-end content etc instead of front in within public pages. Cheers P
  16. Click the little icon above the top right of your last image. Looks like a list icon. Once the images are displayed in a list you should see a recycle bin icon.
  17. Can I suggest a Bulk Actions mechanism for comments which I think is really useful. I relaunched a new ProcessWire website yesterday and we had approx 350 comments overnight. Client has been asking if he can bulk manage them as his previous CMS allowed this.
  18. The trash link is only visible for super users. Agree it'd be helpful to have option to display for other roles.
  19. Ok I got it to work. I realised I had to zap the contents of both 'item_tpl' and item_current_tpl' My final working code is as follows. Apologies if I'm filling up this thread with my own hacked code and examples. Just hoping it's useful to someone in the future. <?php $nav = $modules->get("MarkupSimpleNavigation"); function myItemString(HookEvent $event){ $child = $event->arguments('page'); // current rendered child page // any logic with $child possible here $myimage = $child->nav_icon; // set the return value of this hook to a custom string $event->return .= "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='$child->url'>$child->title</a>"; } $options = array( 'parent_class' => 'parents', 'current_class' => 'current', 'has_children_class' => 'has_children', 'levels' => true, 'levels_prefix' => 'level-', 'max_levels' => 1, 'firstlast' => true, 'collapsed' => false, 'show_root' => true, 'selector' => '', 'selector_field' => 'nav_selector', 'outer_tpl' => '<ul class="sidelist">||</ul>', 'inner_tpl' => '<ul>||</ul>', 'list_tpl' => '<li%s >||</li>', 'list_field_class' => '', 'item_tpl' => '', 'item_current_tpl' => '', 'xtemplates' => '', 'xitem_tpl' => '<a href="{url}">{title}</a>', 'xitem_current_tpl' => '<span>{title}</span>', 'date_format' => 'Y/m/d', 'code_formatting' => false, 'debug' => false ); $root = $page->rootParent; // Start from the top root parent of current page // setup the hook after on ___getItemString($class, $page) method $nav->addHookAfter('getItemString', null, 'myItemString'); echo $nav->render($options, null, $root); ?>
  20. Macrura and Soma - you're both correct. My code only works for the current page. I hadn't realised earlier as I was testing and viewing a single page which just happened to be my current page :-/ Moving on, I've worked Somas example into my template, updated the field names etc to produce the following. As Soma mentioned, this displays an icon only for the current page. <?php $nav = $modules->get("MarkupSimpleNavigation"); function myItemString(HookEvent $event){ // the current rendered child page $child = $event->arguments('page'); // if current child you're viewing if($child === wire("page")) { $myimage = $child->nav_icon; $itemMarkup = "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='{$child->url}'>{$child->title}</a>"; $event->return .= $itemMarkup; // send back the markup that will present a item } } // setup the hook $nav->addHookAfter('getItemString', null, 'myItemString'); // the navigation options $options = array( 'parent_class' => 'parents', 'current_class' => 'current', 'has_children_class' => 'has_children', 'levels' => true, 'levels_prefix' => 'level-', 'max_levels' => 1, 'firstlast' => true, 'collapsed' => false, 'show_root' => true, 'selector' => '', 'selector_field' => 'nav_selector', 'outer_tpl' => '<ul class="sidelist">||</ul>', 'inner_tpl' => '<ul>||</ul>', 'list_tpl' => '<li%s >||</li>', 'list_field_class' => '', 'item_tpl' => '<a href="{url}">{title}</a>', 'item_current_tpl' => '<a href="{url}">{title}</a>', 'xtemplates' => '', 'xitem_tpl' => '<a href="{url}">{title}</a>', 'xitem_current_tpl' => '<span>{title}</span>', 'date_format' => 'Y/m/d', 'code_formatting' => false, 'debug' => false ); $root = $page->rootParent; // Start from the top root parent of current page // a render will then also trigger the hook above on each item echo $nav->render($options, null, $root); ?> The key to getting my menu to produce a unique icon per page seemed to be removing the if($child === wire("page")) function myItemString(HookEvent $event){ // the current rendered child page $child = $event->arguments('page'); $myimage = $child->nav_icon; $itemMarkup = "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='{$child->url}'>{$child->title}</a>"; $event->return .= $itemMarkup; // send back the markup that will present a item } My only problem at the moment is that each navigation link is being output twice.
  21. Each pages navigation link has an icon.
  22. Eventually solved this with the help of a mate who is an experienced PHP developer. <?php $treeMenu = $modules->get("MarkupSimpleNavigation"); $myimage = $page->images->getTag('icon')->width(50)->url; $options = array( 'item_current_tpl' => '<div class="nav-icon"><img src="'.$myimage.'"></div><a href="{url}">{title}</a>', ; ?> We both acknowledge that a better solution is most likely to use the Hook method outlined in the Module readme but I needed something quick (approaching deadline) that I could relate to and maintain myself. Given time I may look more closely at the Hook method and try understand that a bit more.
  23. Wondered if I was along the right track with following. I associate a variable with my image tag including width: $myimage = $page->images->getTag('icon')->width(300)->url; and then in the MarkupSimpleNavigation refer to $myimage in the item_crrent_tpl line 'item_current_tpl' => ' <div class="nav-icon"><img src="{myimage}"></div><a href="{url}">{title}</a> ',
  24. Marek - i like your demos. Very nice work. Have you seen http://mmenu.frebsite.nl/ as a lightweight jQuery approach?
×
×
  • Create New...