-
Posts
7,480 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
@Tramvai, Thanks for using Blog. Unfortunately not automatically. I think you should be able to easily achieve your design with the latest Blog (dev version 2.2.1). You can have a featured image. Using CSS (and maybe PHP as shown by Dave above in post #210), you should be able to line up your Post's date, category, author and comments - I should think...
-
Yes, if using PW 2.5 Modules -> New -> Add module from URL-> point to the zip file in Blog dev branch (if you can't wait till this coming week when I merge to Master). PW will upgrade Blog. Nothing will be reinstalled. The code will be updated. As usual, good to test first before deploying to a production environment. Yes, alternatively, you can manually overwrite the old module files with the new ones...You might then want to refresh your modules list for latest module version numbers to show...
-
No. Have a read here: https://processwire.com/blog/posts/making-efficient-use-of-fields-in-processwire/. Create one such field and change its label in the context of those templates.
-
That's strange! Do you have any additional CKEditor plugins installed?
-
@Tramvai, A little bit more information would be helpful. By removing all formatting, do you mean even paragraph tags are removed? PW version?
-
No worries. Yes, it does work. The only thing to decide is whether you will be calling the function from blog.inc or copy and pasting its code into your own template file (for which you would also need the /markup/nav.php/ code)...Let me know how it goes...
-
Minor updates: Blog version 2.2.1 1. Thanks @Russell, added a 'post_comments' option to renderPosts() 0=do not show comments count on a post 1=show only the top counts icon 2=show only the bottom counts 3=show both top and bottom counts 2. A couple of code optimisations Updated the Dev branch and above post with all the options. Next week I'll merge 2.2.1 into Master.
-
Maybe PM Pierre-Luc the module author or file an issue in the project's page at GitHub since the module does not seem to have a support forum....
-
Give me a couple of minutes...will post a solution... Confirm, do you want the URL to the pages even though the 'title' will actually be the $page->client? --------------------------------------------------------------------- Edit 1 Something like this should work... $posts = $pages->find('template=post, limit=10'); $customUrls = array(); //custom array with $url => $label pairs (url= page url; and label = value of page->client [text]) foreach ($posts as $post) $customUrls[$post->url] = $post->client;//I am assuming $post->client is a text field? echo renderNav('Custom Links', $customUrls);//set the last two parameters if you need to, i.e. $currentURL and $mobile --------------------------------------------------------------------- Edit 2 By the way, above I assume you want to reuse renderNav() within the Blog profile itself. Remember it includes /markup/nav.php/ in line #277. If instead you want to reuse the function elsewhere without having to include nav.php, you can bring in the nav.php code physically into your (copied) renderNav() code. If this is too complicated for you, just copy the renderNav() code from MarkupBlog; it is the same code anyway . The Blog modules tutorials could also be handy. Here's is the renderNav() one.
-
Maybe use Firebug/Chrome developer tools to confirm if form values are sent (POST) so we can narrow down on what is happening
-
Hanna Code will not work without its text formatter . I don't know what set up you have there but like I said - I tested your code, and my code in a field called 'body' that uses CKEditor and it works just fine. Anyway, you seem to have got it sorted....
-
Good. We are getting closer. What is the exact name of your 'body' field (maybe not related but there was a problem with how some HCs were named; what is the name of your HC?). What version of Hanna Code are you using? The latest? Secondly, what are the settings you have in your CKEditor; did you use the same settings in the field you changed from TinyMCE?
-
What I was getting at is to test against a similar field, so in this case, a textarea field called "test" or whatever that uses CKEditor. It sounds to me like that is where the problem is originating from...That would help us narrow down where the problem is coming from...
-
Just curious what settings you have on that body text. Have you tried to test on a different textarea field (i.e. a different 'body' text)?
-
Gideon, Can you confirm that no comments are saved in the page with that comments field? What do you mean by 'there is no response'? Is the form submitted but there is no feedback? Is the form not submitted at all?
-
@Russell Thanks for trying out Blog... Comments count: Good catch. I will work on an option to not show either/both comments' count (i.e. at the top and/or at the bottom) that will override the other comment settings - label, zero text etc... Layout: If you want to use the demo files, you are better of using the blank PW install otherwise (like you found out), _main.php gets in the way (but there should be ways around that). About a mismatch with you site, as I have time and again said, Blog's demo files are just that; demos. They are meant to help you get started. If you know what you are doing (and have read the Blog docs), you don't need to install the demo files. You don't even need to use the template files that come with Blog. You can pretty much call up MarkupBlog from anywhere. So, yes, you don't need blog-main.inc, etc. Having said that, being a Markup Module, Blog has to output some HTML - mainly divs,spans, paragraphs, and anchor tags. That's about it. Styling your site and Blog to match is something left to you, the developer - its basically just CSS. As for renderNav(), that's just a helper method available to you. You don't have to use it; you can create your own Blog navigation. Regarding the mobile detection, it just outputs a class 'no-mobile' that you can target using media queries as shown in the demo blog.css (did you look into that file btw? As per the instructions for installing Blog, It is not copied over automatically to your /site/templates). What other render code is this that you need to rewrite? You don't need to replace MarkupBlog module . Have a look at this (work-in-progress) Blog by Dave. It uses the Blog module but it is pretty much customised to his needs. Similarly, here's another Blog by Peter. I hope these have answered you query. If not, feel free to ask more
-
Hi Gideon So, Welcome to ProcessWire and the forums. Have a read here: https://processwire.com/talk/topic/6417-processwire-profields-table/?p=63119
-
Works fine here...
-
Welcome to PW and the forums palacios000. Your $supplier is in PHP terms an object. With that, you have all attributes of that object at your disposal; its id, name, title, parent, children, when it was created - everything . So all you need to do is, e.g. echo $supplier->title; //or echo $supplier->supp_check_in;//No need to do the $pages->get(1234) again. Here I assume I assume blng_supplier is a single page field. If it is a multiple page field, you would have to loop through it..
-
Glad you got it sorted.. Pagination: That's why I recommended to ensure you use the same PageArray for your totals and the renderPosts(), i.e. the $posts PageArray. Anyway, test and see. Limit: It is always good to limit results. With pagination, users can always get to the next results. What you set as a limit depends on other factors such as site traffic. So, it's up to you really but rule of thumb is to limit results if you don't need to show all of them at once. Code to remove: I meant to uncomment just the code for the totals count but you have already sorted that out, no worries.
-
I was sleepy yesterday ....Ignore some of the above... If you will never use headline counts anywhere else but in your $sidebar, then you can just uncomment the /markup/posts.php code in renderPosts() in blog.inc. This (Blog) is a site profile so you can pretty much do with it as you want...Then, use the code I wrote above to get the total counts in your $sidebar. The only thing to ensure is that you use the same PageArray for $posts for your $sidebar (total count) and your renderPosts() ($content/rest of the post) - hope this makes sense.
-
OK, I get you. In that case you will have the headline counts rendered twice . First on top of your 'rest of the posts' ($content) and secondly in your $sidebar with the code I showed you. You have a couple of options to deal with the first/unwanted headline counts: 1. Use CSS to hide the count in your 'rest of the post' 2. Modify the renderPosts() function to do what you want. 3. Modify /markup/posts.php to do what you want (only send $total if....blah blah -see pseudo code below) 4. Use my Blog module instead with 'post_count' = 0 to not output the posts' count for #3 suggestion..[see edit below; maybe not really necessarily if you want to completely get rid of the counts in renderPosts() if($total && $page->template !='posts') echo "<h3>" . sprintf(__('Posts %1$d to %2$d of %3$d'), $start, $end, $total) . "</h3>"; //OR if($total && $page->template =='blog-list') echo "<h3>" . sprintf(__('Posts %1$d to %2$d of %3$d'), $start, $end, $total) . "</h3>";
-
1. Those are not actual fields per se. No fields are created in the database. The method just 'creates' inputfields (i.e., HTML input 'areas') that are displayed in a module's configuration screen. The user configurable values in those fields are stored in the database (in that module's row in the 'modules' table in the 'data' column) in JSON-like format. On uninstall, a modules record is deleted from the database (i.e. its row in the table 'modules'), so, everything about the module is deleted: public function ___uninstall($class) in /wire/core/Modules.php/ $database = $this->wire('database'); $query = $database->prepare('DELETE FROM modules WHERE class=:class LIMIT 1'); // QA $query->bindValue(":class", $class, PDO::PARAM_STR); $query->execute(); 2. Although there are some methods (functions) specific to modules, you can use any(almost any?) PW and PHP method with modules. It is just PHP . If you are really into this, I would suggest to first study the source code of a couple of modules in the modules directory. If you are curious about some stuff have a glance at Modules.php and Module.php although you really don't need to do this. The following threads are also helpful RE configurable modules: https://processwire.com/talk/topic/5480-configurable-process-module-need-walk-through/ https://processwire.com/talk/topic/3343-how-can-i-setget-module-data-from-db-when-not-implementing-configurablemodule/ https://processwire.com/talk/topic/7581-configurable-module-default-values-on-install/ Other: https://processwire.com/talk/topic/1313-modules-process-and-the-difference/ ...which reminds me, I really need to get write those modules tutorials as promised...
-
Use the following in your blog-list.php if that is where you have your $sidebar $posts = $pages->find('template=blog-post, limit=10');//or whatever the template of a 'post' is $start = $posts->getStart()+1; $end = $start + count($posts)-1; $total = $posts->getTotal(); if($total) echo "<h3>" . sprintf(__('Posts %1$d to %2$d of %3$d'), $start, $end, $total) . "</h3>"; Note: getStart() and getTotal() have nothing to do with renderPosts(). They are both PageArray methods. So, you can use them with any $pages->find() operation. renderPosts(): The first parameter accepts either a PageArray, a Page or a selector string. So, the following should work... $sidebar = renderPosts($posts, true)//our $posts above...which fetched 10 posts However, I am not sure I fully understand your question as renderPosts() with $small=true should already return the counts headline?