Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. The simple solution is: .MarkupPagerNav li { display: none; } .MarkupPagerNavPrevious, .MarkupPagerNavNext { display: inline; } --- EDIT: actually, did you try to set the "numPageLinks" options to 0? $results->renderPager(array( 'numPageLinks' => 0 )); I don't know if it works, but it's worth trying
  2. Try reversing it. You want to sort by created only if news-date doesn't exist, so it should be news-date|created. I'm also not sure if you can reverse the sorting by adding a minus behind each property or if it would work instead simply with: sort=-news_date|created. If it doesn't work like that you can always leave the sort without the minus and use ->reverse() to reverse the order of the pageArray instead.
  3. Steve, you should make a t-shirt for Textile. Somehow it fits
  4. When you look for a solution, this is the one that always comes up http://ben.kulbertis.org/2011/10/synchronizing-a-mysql-database-with-git-and-git-hooks/, it's worth a shot Edit: https://processwire.com/talk/topic/3229-version-control-for-mysql-via-git-hooks/
  5. I think the comments there say it all about the value of that post. About the the paragraph that you quoted, obviously you have to be clear about this with the client.
  6. Hi Cerulean, Thanks for the feedback. I think adding a field to a system template should be done in an informed way by the user of the module, especially if it's a quite quick thing to do and if it won't be needed in all cases. I will update the documentation to be more explicit, though.
  7. Those pages would be language agnostic, so you (your editor) would have to fill the default language name and title, independently of what language it is, and ignore the others. I'm not sure if there is a way to avoid showing the language names based on the template and can't check right now. EDIT: for the Title you can create a non-multilanguage title and use tat one on this template, my doubt is with the page name.
  8. Hi Friedrich, welcome to the forum! This can be done in several ways. and depends a lot on some factors. Will there be any news in several languages, or they will always be each one in it's own language? If they will be sometimes in only one language, but other times in more, I would ignore those active checkboxes in the settings, and create my own checkboxes in the main edit page. For this, simply create a page field type, choose checkboxes as the input field type and choose the languages page as parent. Add it to your articles template, and you will have the three languages, with a checkbox each. Then, on your template you can do something like this to get the news: //let's say the new field is called "active" $lang = $user->language; //the language being viewed in the browser $news = $pages->find("parent=news, active={$lang}"); we're getting all the news where this language is selected foreach($news as $article) { // echo things } If each article will be only in one language you can simply create a news page for each languages and create the articles for that language as children with non multi language fields. Then show one news parent or the other depending on the language. This solution is probably simpler for the editor, but probably a little more difficult to set up.
  9. The request you don't do in pw, you do it in JavaScript. You'll have to study that part for yourself I'm afraid. Google ajax, have a look at the jquery ajax methods, read a book on javascript and so on.
  10. Well, the fields are not really inside the fieldset, so you can’t get them in an easy way. What you can is look for the fieldset_open and get all the fields after that and before fieldset_close. Have to go, so no code example, I’m sure you’ll get it from here
  11. A very simplified example. Reloading only the page content via ajax: if( !$config->ajax ) include("head.inc"); echo $page->body; if( !$config->ajax ) include("foot.inc");
  12. Nice one Nico! I have some trouble with the nav, though. It's not the first time I see this, but linking to anchors of other pages feels very confusing to me because you skip the header. Really not the first website where I feel this way, happens from time to time and the process and reaction is always the same: click link > have the feeling that something is missing > scroll down, see unrelated content > scroll up, find the header > "achso, i was halfway down already!" PS: I hope you liked my "achso" there
  13. Aaaaarg! Thanks adrian, corrected!
  14. Will look into it later. Make sure this text formatter is the last one being added in the field settings
  15. You can do anything after pressing the save button Just create a module that hooks on save and do all the magic there. I don't have time to help you with the code now, but I'm sure someone will step in. You can also have a look at the code of any module in the directory that operate on page save. Consider also playing with the visibility options on the field settings. Might make sense in your case.
  16. You could add them with some JS with Admin Custom Files http://modules.processwire.com/modules/admin-custom-files/ Something like: $(".InputfieldPageTableButtons").each(function(){ $myButtons = $(this); $myTableContainer = $myButtons.closest(".InputfieldPageTableContainer"); $myButtons.clone().prependTo($myTableContainer); }); (written in the browser and not tested)
  17. Adrian, I don't think that does what was asked. $fields will will get all the fields that you created, not the ones that are in the pages. hsanabria, you have to identify which fields represent other pages. Using your example: foreach($page->fields as $field) { $fieldValue = $page->get($field->name); echo $field; foreach($fieldValue as $innerPage) { // if value of the field is a page array, we can iterate it foreach($innerPage->fields as $innerPageField) { $innerPageFieldValue = $innerPage->get($innerPageField->name); echo $innerPageFieldValue; } } } Of course it would be much simpler to create a general function that iterates the fields of a page and call it recursively if that field is a page array. But I hope this serves as an example.
  18. I liked the formatting! Don't listen to these boring central europeans
  19. The problem is that you are choosing 6 from each category, and not 6 from all. The ideal would be to get all the portfolio pages with one selector. There are several ways of doing this, the one that looks more logical in your case is to select by template: $portfolio_pages = $pages->find("template=portfolio-item, limit=6, sort=random"); foreach($portfolio_pages as $item) { // echo here }
  20. Sure, I'll send you a PM asking for more details.
  21. Hi David, I'm the person that built the website you're linking to. I will be glad to give you a quote for a website thought from scratch for your client's needs, but not directly based on that one. In case you do the work with someone else, I would just ask you not to copy Nicole's website. I'm sure you understand my concern.
  22. I changed both modules info to compatible with 2.6 The MarkupImages hijacks the html markup after any other text formatter already did it's work, so I don't see why it wouldn't work with plain html. Can you post here the code you used? If you're doing something like this this, it should work: <img src="images:2"/>
  23. It's not good to reinvent the wheel, but it's not bad to know how wheels are made. What you want to do is actually quite simple, and all you need is a loop inside the first loop. For only two levels, a very simplified version could look like this: echo "<ul>"; foreach($homepage->children as $item) { // loop through the children of root echo "<li><a href='$item->url'>$item->title</a>"; if ($item->numChildren(true)) { // check if this item has children echo "<ul>"; foreach($item->children as $sub_item) { // loop through the children of each item echo "<li><a href='$sub-item->url'>$sub_item->title</a></li>"; } echo "</ul>"; } echo "</li>"; } echo "</ul>"; For more levels, you could keep adding loops inside loops, but then, it would make more sense to make a recursive function (a function that calls itself while there still are children). One more thing. In your code you add the id for the current page like this: if($child->id == $page->rootParent->id) { // this $child page is currently being viewed (or one of it's children/descendents) // so we highlight it as the current page in the navigation echo "<li><a href='$child->url' id='current'>$child->title</a></li>"; } else { echo "<li><a href='$child->url'>$child->title</a></li>"; } You can avoid repeating code by doing this instead: if($child->id == $page->rootParent->id) { $current = ' class="current"'; } else { $current = ''; } echo "<li><a href='$child->url'{$current}'>$child->title</a></li>"; Or, more compact: $current = $child->id == $page->rootParent->id ? ' class="current"' : ''; echo "<li><a href='$child->url'{$current}'>$child->title</a></li>"; You can also replace $child->id == $page->rootParent->id by $item == $page for the current page and use rootParent to give the class to the parent item only
  24. Tell me if I understood it all wrong, but what you are describing here is the pageTable field. Did you have a look at pageTable Extended? It comes even closer visualy to what you described.
×
×
  • Create New...