Jump to content

ferahl

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by ferahl

  1. With regards to the error "Failed to initialize storage module: memcache" This happened when moving my project to remote hosting which is running php 5.3.10 and my local is running 5.3.13. I tracked the bug down to sessions and saw that my remote host sets the temp session directory to some TCP ip address so thought it might be that. I tried just changing it to /tmp but the problem prevailed. As a stab in the dark I added: session_start(); at the top of index.php and all problems solved! When I remove it though the problem is back. I also cleared the session asset folder but it didn't make a difference either way.
  2. Damn pretty obvious! $post->category->first()->title worked thanks a lot!
  3. Hi, I am printing out some "post" page children on my home page. These "post" pages have a field called "category" which is a fixed list of pages - "News/Events/Projects". My code looks like this: $posts = $pages->find("parent=/posts/, limit=6"); foreach($posts as $post) { // render out } The field name is "category" but when I do $post->category it returns a page ID like 1014, if I do: $pages->get($post->category)->title This returns "Home" instead of the category which is one of "News/Events/Projects". What am I doing wrong? Thanks
  4. Pagination works a charm unless you put the search limit to 1. In this case the starting page has no pagination, but if you browse to another page e.g. /page2 the pagination works there. I'm not doing single item pagination but just saying as I am sure someone will at some point! Here is my code that breaks it: $posts = $pages->find("parent=/posts/, category.title=Events, limit=1"); $posts->renderPager();
  5. Hi, I have created a post-like structure like this: Page: Posts Page: Category Posts has a field called "category" which is derived from the Category page's children - these children simply have a title field e.g. ("Events", "News" etc) I would like to filter the children of Posts based on this field, something like this: $posts = $pages->get('/posts/')->children("category=events"); However category is a number, in my case Events is the number 1014. Obviously I want to filter by a string instead. How can I do this? Thanks in advance for your help! /////////////////////////////////////// Apologies, after I wrote this I saw a related page at the bottom. Here is the solution for completeness: http://processwire.c...a-selector-tag/ $category = $pages->get("/category/events/"); $posts = $pages->get('/posts/')->children("category=$category"); Nice and easy
  6. Aha thanks, I was confused because I was using the built in "headline" field not realising that this was being sanitized but a normal text field is not being. Tried a normal text field and it works just fine.
  7. Firstly I am loving the CMS, so glad that I found it. I have worked with and tinkered with many and literally non have excited me except this one. I only started playing yesterday and I have a few questions I'd appreciate some advice on: tokens/sanitization/html fields For some of my fields I would like to be able to use tokens for example "It's in the [highlight]Game[/highlight]". Failing this I would like to create simple single line fields which accept some html tags like span/em/strong. Also in the stock installation I don't see a field that allows html - just a "Text" field. Thanks!
×
×
  • Create New...