-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
it will work just change it to this. ... if ($blog_entry->getItemKey($entry) % 2) {$class .= ' blog_box_even';} if ($entry == $blog_entry->first()) {$class .= ' blog_box_first';} elseif ($entry == $blog_entry->last()) {$class .= ' blog_box_last';} ...
-
It is possible $field2 = $page->field2; $result = $pages->find("template=something, field1>$field2"); Edit: ah hehe, ok this is what you're looking for. $results = new PageArray(); foreach( $pages->find('template=something') as $p) { if($p->field1 > $p->field2) $results->import($p); } Anyway have you tried your version if it would work?
-
There's an option underneath the templates fields to use fieldset of another template.
-
like this: <?php $testimonial = $page->children(); foreach ($tm as $item) { $class = ''; $count = $tm->getItemKey($item) + 1; if(!0 == $count % 2) $class = 'odd'; if($tm->first() === $item) $class .= ' first-item'; if($tm->last() === $item) $class .= ' last-item'; ?> <div class="testimonial_box<?php echo " $class"; ?>"> <?php echo $item->body; ?> <p><?php echo $item->title; ?></p> </div> <?php } ?>
-
onjegolders, look at my first example. ->first(), ->last() can also be used. But that limits it to first and last. With $pagearry->getItemKey($page) you can get the position index 0,1,2,3... So you can use $count = $array->getItemKey($page) + 1; to get the count for each loop.
-
How can end-users add gaps/margins in TinyMCE?
Soma replied to onjegolders's topic in General Support
You can add custom configuration in TinyMCE. In the field settings under "Input" tab. You find the "TinyMCE Advanced Configuration Options". There you find some fields to overwrite settings. You could try the options in TinyMCE for newlines behaviour. Though I'm not sure, since I don't use them, what would be what you need. http://www.tinymce.c...rce_br_newlines In the setting field "Additional TinyMCE settings" you have a textarea to specify configs in a key:value format, each on a newline. So you could add these (no apostrophes needed or endline ","): force_br_newlines : true force_p_newlines : false -
http://caniuse.com/#search=first If you still support IE6 it's not, but there's polyfills in case. there's common techniques in programming that goes beyond PW API or php. something like this for example? $i = 0; foroeach($pa as $p){ $i++; if(0 == $i % 2) $class = ' class="last-row"'; echo "<div$class>$p->title</div>"; }
-
Thanks for the update. The save button now works. 1. When debug mode on, it breaks the admin. Notice shows up and page tree doesn't get loaded. Notice: Undefined index: id in /.../site/modules/ProcessPreview/ProcessPreview.module on line 31 2. Still, when I open a page, edit something in the text, click "preview" it opens window, but the text change isn't there. When I close the window and hit "preview" again, it shows the updated text. Which means it only works every 2th time I hit "preview" when I change a text. In other words, everytime I change a text I have to open "preview" 2 times to see the change.
-
CSS: .box::first-child{} .box::last-child{} in Processwire API PHP foreach($pagearray as $p){ if($p === $pagearray->first()) ....; if($p === $pagearray->last()) ....; echo ... }
-
Well, it doesn't. Save button is broken after using "preview" ones. And the preview only shows the changed text every 2th time I click "preview".
-
Ahh sorry now I see it does some saving of the page (post). If I change the title it does show on preview without saving.. but it doesn't seem to work always only every 2th time? There's something strange that's why I assumed it doesn't save. Also will this approach work with when there's some logic happen in the template view to show something based on the pages id or childs?
-
Nico thanks for the update! I just gave it a try. But... Do you know that the "view" button of PW does actually same as this module? Any logged in user that can edit/view a page can also "view" it even if the page is unpublished. I didn't knew that for some time. So this module could just add a target='_blank' attribute to the "view" tab and do the exactly same. The other thing is: This module doesn't do what I expect from a "preview" module. I would assume that when I want to "preview" a page I'm editing, that it works without saving the page actually. I guess there would be the need to have a more complicated process going to get this work. I can't think of any atm. But I'm sure there is one. After testing you module, there was an issue when I click preview, it opens new window. I close the window, and when I click "save" it open 1-2 Windows again with the preview. I close them and still the same. I need to reload the page to get saving to work.
-
Hey welcome to the forums moose. Glad you figured it out yourself. Just wanted to inform that my darknight theme isn't currently on latest PW. It needs some adaption, since there's some new things introduced like multilang admin, and field cols. Possibly that there's some issues.
-
I don't think you want to take that route, as it is used by many things, mostly javascripts. Too much, if you ask me, to change. Not sure. Changing host is the best solution. Or maybe there's a workaround to implement that functionality using a class, but not even sure if that would work.
-
Since I don't know when, I got problem with the TinyMCE setting table attribute to 100%. The attribute get's stripped off when saved. All other attributes work. Anyone have same issue or know how to fix it? I'm sure it worked before. So maybe this has to do with the new TinyMCE version 3.4.7? This is the valid_elements: @[id|class],a[href|target|name|title],strong/b,em/i,br,img[src|id|class|width|height|alt],ul,ol,li,p[class],h2,h3,h4,blockquote,-p,-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],code,pre,sup Doing this it works setting it always to 100%: ...-table[border=0|cellspacing|cellpadding|width=100%|frame|rules|height|align|summary|bgcolor|background|bordercolor]... Solution: add the "style" attribute to the valid elements, as TinyMCE converts the width="100%" to style="width:100%". To allow it for all add it to @[id,class|style] or just the table elements.
-
You think? Then your second example wouldnt work either. You can add include=all and it will ignore permissions.
-
Then he's second example wouldn't work either I guess.
-
I am also using latest PW. But I guess you haven't turned on debug mode, that's why you don't see the warning it. It may still be working, haven't really tested further. It's always confusing with those warnings. Sorry, changed title.
-
It works normally here as it should. Can you provide more details, where and how you're using it?
-
Have you made your date field "autojoin"? Without setting it you cant sort by the field. On a side note, formatted dates can be sorted using "Y-m-d". For example in a sortable table.
-
Alan, this seemed to be true for 2.0. I think. I would search with site:processwire.com permission page-edit https://www.google.c...iw=1352&bih=850 Mainly it's simple and straight forward. If the module has no "permission" set only superuser will see it. If it has a "permission" the user has assigned to one of he's roles he will see the page in the admin. So "page-edit" is a possibility, but not the only solution. If one creates a module (look at AdminBar) he can decide to give it for example a "adminbar" permission, so it can be used for site admin to give access to only certain users using that permission. Edit: So far this is mainly for advanced module developement, which isn't covered anywhere yet, but will in the near future.
-
MarkupLoadRSS, I get this warning: Strict Standards: Declaration of MarkupLoadRSS::error() should be compatible with that of Wire::error() in /.../htdocs/pw-dev/site/modules/MarkupLoadRSS.module on line 143 with module MarkupLoadGCal: Strict Standards: Declaration of MarkupLoadGCal::error() should be compatible with that of Wire::error() in /.../htdocs/pw-dev/site/modules/MarkupLoadGCal/MarkupLoadGCal.module on line 25
-
Alan, for non superuser to see the custom admin page, the module requires a permission set in getModuleInfo static method: simplest would be to add: "permission" => "page-edit" you could also create a custom permission and add that to the roles you want them to see the admin page.
-
Permissions are text based. While there's some already there used by system, you can simply add custom permission you then can use for your module or in templates: $user->hasPermission("mypermission")