Jump to content

kongondo

PW-Moderators
  • Posts

    7,480
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. I am a bit confused why you would want to add the fields via the API? If a client wanted a new functionality that required adding new fields, why not just log in as admin and add the fields? Anyway, adding fields of course implies not only creating them but adding them to a template. Adding fields to a template is a two step process. In the first instance, you create a fieldgroup and add fields to it. You then add the fieldgroup to a template. In your case, you would be adding to an existing template so you may not need to create the fieldgroup, rather to 'get' it. If you are not afraid of looking at code, have a look at BlogInstallWizard.php (part of the Blog module). There's examples for adding different types of fields as well as adding to an existing template. At the moment we don't have a dedicated resource that lists the properties of each field type. There are nuggets of knowledge here and there in the forums. My favourite (though probably incomplete and outdated for now) is the APIGen for PW. http://processwire.com/apigen/namespace-None.html. On my local setup, I generate apigen docs based on the latest PW and pulling not only .php files but also .module files. Btw, as part of my upcoming 'ProcessWire Modules' tutorials, I will be writing about this...
  2. Last I checked Atom did not support PHP - a big turn off for me!
  3. Have you gone through this? https://processwire.com/docs/tutorials/troubleshooting-guide/
  4. You need to 'read' MarkupBlog code . Search for rtrim to see an example.. rtrim() http://php.net/manual/en/function.rtrim.php
  5. Hey Jan, cool 'experiment'! Even if this may become obsolete soon, I think it will be a useful learning tool for some of us and a nice toy to play with - so a great addition, thanks!
  6. Yep, I agree with Joss here. If you wanted to manipulate the value at runtime, here's an example based on Joss PHP date thingy... $myDate = date('F Y', $pages->get(5108)->getUnformatted('blog_date')); echo $myDate; //Outputs August 2014, for example.
  7. Why do you think the conversation wouldn't be seen? Module developers follow the support forums of their modules and are notified of new posts If we were to open new topics just because some threads were 'long' things could become chaotic and confusing very quickly. This forum is Hanna Code's support forum. You have raised a Hanna Code support question hence it should be here . To further clarify...(not just for you): Each module has (should have) its own support forum. these are found here: https://processwire.com/talk/forum/4-modulesplugins/ If one wants to discuss general module development they should post them in this sub-forum: https://processwire.com/talk/forum/19-moduleplugin-development/ I hope these clarify things.
  8. That's still a strange path. Blog files should be in /site/modules/ProcessBlog/. E.g. /site/modules/ProcessBlog/ProcessBlog.module. Did you create the 'Blog' folder yourself?
  9. Btw, Peter, what is your use case? Do you have a page that will list all tags used across your Blog? If that is the case, then you should be doing this a little bit differently...
  10. Seem we posted near same time..See my response above yours
  11. blog_tags is also a PageArray. You would have to loop through it as well. Something like below. However, note, the below will produce duplicates since tags are reusable across multiple posts...If you need unique values just holla and we'll sort that out for ya.. $mytags = $pages->find("template=blog-post");//All pages based on blog-post template foreach($mytags as $taglet){ //blog_tags return a PageArray so we loop through them as well //I don't think this is exactly what you want because this will output all tags used, i.e. there will be duplicates foreach ($taglet->blog_tags as $t) { echo "Tags:{$t->title}"; } }
  12. @Peter, Since an upgrade doesn't reinstall the module, any custom fields or pages you add post-install should survive.
  13. Updated Blog (master/modules directory) to version 2.3.0. See post #244 above for explanation of changes.
  14. @Russell - I don't completely follow. Running the module in a sub-directory doesn't seem like a good idea. Delete the sub-directory one. Then update the one in your /site/modules/ directory. If you can wait a few minutes I will be merging the dev and master branches. This way, you can update as normal. If you can't wait, you can also just copy and paste all the latest module files (minus the template files, of course) and paste this in your /site/modules/ProcessBlog/ directory overwriting the older ones. Btw, note that PW now saves an older copy of your module directory when you update a module (don't know if this only happens when you update from URL or uploading a file in contrast to updating via PW's modules' directory. So, you might see a folder .ProcessBlog - that is a backup of older files when you update. Edit Realised I didn't answer you question about deleting Blog Pages. As I had mentioned in a previous post and now updated README to include this (thanks...)
  15. Do you want to mark this as solved then?
  16. Nice site Joss! (Cheap MOT too...sadly not in my neck of the woods )
  17. You previously mentioned the Blog Module. Is this image field related to Blog?
  18. See these examples: http://processwire.com/api/variables/pages/ https://processwire.com/talk/topic/1153-adding-images-to-a-page-via-the-api/ https://processwire.com/talk/topic/1153-adding-images-to-a-page-via-the-api/?p=10334 https://processwire.com/talk/topic/206-renaming-uploaded-files-from-tmp-name/#entry1371
  19. Not wanting to assume the OP's expertise in PW, I think it is important to clarify that this should only ever be 'on' while developing and never on a production/live install
  20. Target the div.post instead. Each post is wrapped in a <div class='post'>.....</div>
  21. Uh...actually, I posted that very same link (+ two other related ones) in the thread you started here: https://processwire.com/talk/topic/8244-gettotal-returns-wrong-value/?p=80042
  22. Seems you didn't really read my post #12 here: https://processwire.com/talk/topic/8244-gettotal-returns-wrong-value/?p=80042
×
×
  • Create New...