Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. sorry for the messy sentence I just meant having them visible as in any blog
  2. If you assign to those pages a template without file they will always be hidden and you don't have to worry about it. And if you don't want them to be viewable, I'm assuming you didn't setup a template file. As for the larger question: I wouldn't say you're wrong, but you could have all the tags listed on your tagging page, and on each tag page, all the articles tagged with it. It's not much work, and maybe nicer than having them hidden.
  3. @jgerbracht, with page field you can choose any field of the targeted page for it's label. I just tried it, and the label does change when you modify this field on the selected page.
  4. Vítor, I tried to reproduce this and I think I understand what happened to you because I was also confused for one moment. I think maybe you changed the label thinking it was the title, and because in this case they are the same, you don't get immediate differences while editing the template. To confirm the change, you have to go edit a page that uses this template.
  5. I think you can use array_diff() to compare $pages->find("template=basic-page") with $pages->find("template=basic-page, limit=10") and return the difference. I didn't test it, and can't do it now.
  6. If you want to do it often, you can put a checkbox on your home template to turn this OF and ON
  7. I think tinyMCE needs some love in PW maybe having more options for it on the module edit page, and not only when assigning it to fields. It could be possible to link to a new skin, to add customized buttons, etc etc. I know this is a lot of work, but maybe it would be worth it, giving the high demand
  8. Thanks Ryan. So, we can make Pete's suggestion even a little bit smaller $limit = 5; $projects = $page->children("limit=$limit"); $total = ceil($projects->getTotal() / $limit); edit: this is the version I'm using now. And works as expected. I was asking this because I wanted to have a pagination that is not possible with renderPager. I don't want the numbers (only previous and next buttons), and I also needed them to have different text depending on the page they are in: if in the fisrt page: [ next projects ] if in the middle: [ previous | next projects ] if in the last page: [ previous projects ] It's working as I wanted with my handcrafted solution, but as I said, I was wondering if it would be simpler to do it differently.
  9. Maybe you should try one more time. Give sublime text a chance, and you will see how great it is. It even as a vintage mode that works like vim
  10. You have the same screenshot on both situations, but I think I get what you want to do. If it's what I think, maybe you can do it even without telling the editor to set the width. I would do it like this: on the PW tree: home -rows --row1 --row2 --row3 each page "row" will have repeatable fields for segments (put only the tinyMCE text here, not the width field) Now, the editor can create a new row by adding a new page and populating it with as many segments as he wants. On your template for "rows" you can count how many segments were added, and give classes to them accordingly. So, assuming that this repeatable field is called "segments": foreach($page->children as $row){ $n = $row->segments->count(); echo "<li class="row">; foreach($row->segments as $segment){ if($n == 1) echo "<div class='grid_4'>{$segment->body}</div>"; if($n == 2) echo "<div class='grid_3'>{$segment->body}</div>"; if($n == 3) echo "<div class='grid_2'>{$segment->body}</div>"; if($n == 4) echo "<div class='grid_1'>{$segment->body}</div>"; } echo "</li>"; } I didn't test the code, and I'm skipping all checkings if the fields exist and what to do if editors add more fields. And I've seen that there are already two more answers while I was writing, but I will post this anyway and read them after EDIT: nice answer Ryan! EDIT2: My code can be smaller and more automatic of course, but I will keep it like this to be more understandable
  11. Thanks Pete! It's certainly not a big issue, I'm asking more for curiosity. I will use PW's count function as you suggested though
  12. How are you going to group these? I mean, will you group them explicitly (like one group on each entry), or automatically (based on the widths)? I'm not sure if I understand what you want to achieve with this, but maybe this thread could help: http://processwire.com/talk/topic/968-select-custom-css-for-page/page__hl__columns__fromsearch__1
  13. Slkwrm, this will give me the total results on each page. What I want is the number pages resulting from the slicing: If there are 32 children, and the limit per page is 5, i will have 7 pages of results. 7 is the number I need here.
  14. Is there any built in method that returns the total number of used pages when using pagination? I did this "by hand" by dividing the total pages by the chosen limit and rounding this number up: $limit = 5; $children = $page->children; $projects = $page->children("limit=$limit"); $total = ceil(count($children) / $limit); This is working perfectly, but I'm wondering if Ryan already made it simpler for us ps: I know about MarkupPagerNav of course, but I need this for something customized.
  15. Sorry Dave
  16. Maybe something as simple as having the options to show only uninstalled/installed, and core/noncore modules would already be very useful
  17. what kind of field? does it work on other templates?
  18. I used responsive design here http://www.max-cafe-bar.de/. but no images were involved
  19. I'm glad it's too complex for you guys too i felt a little dumb while reading those docs... but still, I really value any effort of making different tools be able to communicate and work together. I have a look at ProcessPageSearch, and see if I can get a sense of it.
  20. I'm not really planning to do something with it right now, i was just curious after reading that article, and all that followed. But, ya, would be nice It would! Would also be nice if it would be on the core, and with documentation. I imagined that doing this would be something trivial with PW, but couldn't find anything on the site or on the forums about it... and since it's something that some CMS's make a big fuzz about... Also, what are your thoughts on CMIS? I'm all for standards implementation, and this looks pretty interesting. Again... this is a muddy area for me, sorry if i'm not making pertinent questions
  21. after reading this article http://www.searchenginejournal.com/why-arent-you-paying-attention-to-apis-for-your-cms/41155/, I started looking a bit deeper on what it means and how hard would it be for PW to have such an API... I didn't come to a conclusion, as would be expectable from such a noobie in such things but still, I wanted to post here some of the documents I stumbled on to tease you people to have a thought on this. http://ecmarchitect.com/archives/2009/11/23/1094 http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=cmis http://rest.elkstein.org/ http://docs.fuelphp.com/general/controllers/rest.html http://wiki.alfresco.com/wiki/CMIS http://drupal.org/project/cmis http://www.elefantcms.com/wiki/RESTful-APIs http://mambo-manual.org/display/dev/Interacting+with+the+RESTful+API
  22. In this case, what you need is to create a custom button that will put <span class="custom"></span> around the content. I know it's possible to do it in tinyMCE, but I wonder if it's possible by using the additional tinyMCE setting on each field, so you don't have to mess around with the module.
  23. You can assign fields to templates like this: $template = $templates->get("some_template"); $template->fields->add("newfield"); $template->fields->save(); this code is taken from here http://processwire.c...bles/templates/ So, just make an array with all the templates you want the field to be on, and go for it $ts = array("home", "basic-page", "search"); foreach($ts as $t){ $template = $templates->get($t); $template->fields->add("newfield"); $template->fields->save(); } EDIT: the field will be on the last position of each template
  24. I agree with Adam, no plausible reason for js here
×
×
  • Create New...