Jump to content

Gazley

Members
  • Posts

    526
  • Joined

  • Last visited

Everything posted by Gazley

  1. Hi there, I'm using a TextArea for a body field and the Textile plugin. All works well, except when I insert apostrophes, I'm seeing funky characters like: I I add the HTML Encoder formatter, I funky characters go away but, the Textile output breaks Any ideas on what I need to do to get the benefit of both? Many thanks!
  2. Hi there, I think this question has probably been asked a million times but I can't seem to see the answer! I've just converted a Body field from using Textile to using CkEditor. I have an "Intro" style that I'd like to specify against the opening paragraph. In Textile, I'd use p(intro). How do I specify a class name to blocks of markup in CkEditor? I don't want to specify the CSS itself as I do this in SASS with the stylesheets linked to the pages. I just want to be able to specify class names to things like paragraphs, headings, lists and so on. Cheers!
  3. Hi @tpr - thanks for pointing out the Uikit capability. I use the fixed/sticky option in Foundation but it isn't nearly as good as what you have pointed out in Uikit. The example at http://getuikit.com/docs/sticky.html#sticky-boundary is not unlike the effect from the Vogue article but I'll have to study that a little more. In the Vogue page, all of the markup seems to be more or less stacked with the left-side elements absolutely positioned. If you collapse the width of the page, all the items just stack. I don't know whether the same effect is achievable with Uikit's sticky. Very impressed with what I have just seen in Uikit -- maybe time to change. Thanks again
  4. Hi there, First, sorry, this isn't a PW question but something I'd love to do in PW if I could figure out how! Looking at this following page: http://www.vogue.co.uk/news/2015/05/22/nicholas-hoult-laura-bailey-interview-june-issue-2015-british-vogue Sizing the browser at min 1200px wide, if you scroll the page, there is a fantastic effect where the main content to the right scrolls and the image in the narrower left columns stays fixed until the copy underneath it, nudges the image out of fixed position and the copy itself assumes fixed position. That is until the next image in the left column comes into view where it assumes the fixed position and the copy moves up. This effect toggles between the image and the copy until the end of the scroll. Is this done using javascript? The effect is really awesome and I'd love to know how to do this! Cheers!
  5. @macrura I can't see how you can add a field to the template that is a button - is there such a field type? If there was a way to add a button to the page, I'm not at all sure how to add JS/Ajax to an "admin" type of page. Obviously, there is a way to do this but I haven't done this before - I've only added Ajax to pages that render on the public facing site, not the "admin" pages. For sure, I have things to learn about customising admin pages! @adrian - Thanks for this information. I do have the Profield modules so can take a look at your approach.
  6. Hi there, I have a template/page that uses hooks to achieve various things. When the admin user has logged on to the admin site and goes to the page in question (customer), she might want to simply click a button to send a specific email to the customer in question. Right now, I have a "send email" checkbox in the template and in the "before saved" hook, it detects the selection and sends the email. In reality, quite often, the admin user ticks the "send email" checkbox and forgets to click the page's "saved" button. This isn't really surprising because it's a little counter-intuitive. The "send email" job is an action and I'm currently treating it like a data change/save process. Is there a way to create an action button in a page when in PW's admin mode? Many thanks.
  7. Wow! Thanks guys - awesome replies and plenty for me to check out!
  8. Hi there, In the past, I've used RoyalSlider for slide shows but generally find it a bit "convoluted". I also use an image caching service that serves up the best images for the page/device/bandwidth and because a piece of JS fetches the images (based on html5 attributes), this can cause a few issues with slideshows. I just wondered whether there is any particular slideshow used by PW devs that is considered to be really good? I'd appreciate any recommendations! Cheers.
  9. Hi @Kongondo, This appears to be a slightly more tricky problem than originally anticipated. I thought I had a workaround to the issue by stripping out the embedded 'h2' elements from inside the paragraphs and replacing them with an empty string. This worked until I tested with different posts with differing text and headers. I ended up hitting the same issue again with the DOM parser choking because the post truncating code that makes the post "small" did not take account of the need for a closing 'h2' element and inadvertently trims the small post string with a now malformed 'h2' element (it has a <h2> but no </h2>). This means that my parsing RegExp fails because it aims to replace <h2>...</h2> and of course, the </h2> may have been trimmed by "smallification". In any event, I'm still left with a paragraph that contains an <h2> that isn't closed which I still incorrectly formed HTML. I hope this makes sense! Cheers.
  10. Hi @Kongondo, Sorry my previous post was a "red-herring". The <p> were balanced. The problem is that now I am allowing 'h2' elements through, the blog markup code is wrapping the 'h2' element pairs in 'p' tags which is in-turn causing the DOM parser to choke. I assume that from the HTML DOM perspective, you cannot have a heading element inside a paragraph element? Cheers!
  11. Hi @Kongondo, Just a heads-up, I'm noticing that the markup returned by renderPost "small" returns an uneven set of <p> elements. In my case, the markup encounters a ... </p> which is followed later on by <p> .... </p>. I noticed this by passing the code into a DOM parser that was choking on the uneven elements. Can you confirm you see this too? Cheers!
  12. Hi @Kongondo, I just knew you'd have a "secret" answer Cheers!
  13. Hi @Kongondo, Happy New Year to everyone! When using renderPosts with "small" set true, the text that is output takes any headings in the post (h2's in my case), strips the h2 elements, leaving the rendered h2's innerText in-line with the body copy. The headings are not meant to be read in-line and as a result, what is output in the summary rendering doesn't read very well. As everything is output in a single paragraph, I guess I need to have the headings completely stripped out of the copy. I can't believe this hasn't happened before - any thoughts, recommendations? Cheers!
  14. Hi @toothpaste, To prove it out, why not try something like this $posts = $pages->find('template=blog-post, limit=5'); and see whether you get the page posts you expect in the page array. If you do, then try this: $content .= $blog->renderPosts($posts, true);
  15. Here is my blog-post template: <?php $spex->setLayout('two-column'); $blog = $modules->get('MarkupBlog'); $blogPost = $blog->renderPosts($page, false, [ 'post_large_headline_tag' => 'h1', 'post_comments' => 0 ]); $dom = $modules->get('BlogMicrodata'); echo $spex->partial('blog_post', [ 'blog_post' => $dom->enrich($blogPost) ]); $spex->slot('sidebar_content', $spex->partial('blog_categories') . $spex->partial('blog_tags')); ?> <?php $spex->docReady() ?> <?php $spex->docReady() ?> I'm simply calling renderPost(), passing its output into my module (BlogMicrodata) via $dom->enrich($blogPost) (which decorates the blog markup with microdata) that in turn is passed into a partial, that in turn is echoed into a template called "two-column". I've chosen to use the Spex module for my templating mechanism. Irrespective, it all resolves into a target DIV in a PHP file. All of the blog markup is returned from renderPosts(). All you need to do is echo that markup into your wrapper template.
  16. Peter & Sephiroth, It is trivial to add extra fields pulled from any PW page into the generated output without having to modify the blog module code. When you call the renderPost() function (or any of the blog functions), you'll get the markup. Using something like QueryPath (http://querypath.org/), you can convert your blog markup into a DOM object that responds to jQuery-like CSS3 selectors and modify the markup, adding whatever you want into the DOM tree. When you are done, then simply call the html() method on the modified QueryPath object and echo the converted markup into your PW template. I hope this helps.
  17. Hi Kongondo, Thanks for the heads-up! That's great to hear - now I can add my little standard "bits and pieces" and all will be well in my world Getting along great with the Blog; thanks once again for providing such an awesome module! Cheers.
  18. Hi, I would like to add some of my standard fields to the blog templates. These trigger support for generating microdata and so on. Are there any obvious reasons not to do this? Any advice much appreciated! Cheers.
  19. Hi Kongondo, I've resolved the issue and this was the problem: xdebug.max_nesting_level=100 I use Xdebug and your installation had originally crashed because the PHP program nesting level had hit this limit. I've no idea why this Xdebug setting should impact on PHP when not debugging but for whatever reason, it was. I extended this to 200 and voila - it installed just fine! I couldn't ever run Cleanup because it never (I presume) got far enough along in the install before it crashed due to the nesting limit. In any event, I reverted to backup (again) with the higher nesting limit and it all functioned perfectly! Now, all I have to do is learn to use the MarkupBlog module Anyway, thanks for being calm and patient and making this work available. The dashboard and utilities look really great and I'm glad I don't have to code up another half-baked, home-made blog yet again! Cheers.
  20. Hi, I installed it once and hit the error. I manually uninstalled it and tried again and hit the error. As a result, I reverted to a backup from days ago, before I even downloaded the Blog module. I installed clean and still hit the error presented in my second error listing. I haven't installed and uninstalled or anything like that. I just hit the error right away.
  21. I reverted to backups of my development environment and the DB. I installed the Blog Module again, from scratch and got the following errors: TemplateFile: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'field_blog_categories' already exists<pre>#0 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Fieldtype.php(440): PDOStatement->execute() #1 [internal function]: Fieldtype->___createField(Object(Field)) #2 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #3 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('createField', Array) #4 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Fields.php(207): Wire->__call('createField', Array) #5 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Fields.php(207): FieldtypePage->createField(Object(Field)) #6 [internal function]: Fields->___save(Object(Field)) #7 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #8 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('save', Array) #9 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Field.php(392): Wire->__call('save', Array) #10 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Field.php(392): Fields->save(Object(Field)) #11 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/BlogInstallWizard.php(436): Field->save() #12 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/BlogInstallWizard.php(334): BlogInstallWizard->createFields() #13 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/BlogInstallWizard.php(304): BlogInstallWizard->createRole() #14 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/ProcessBlog.module(2847): BlogInstallWizard->verifyInstall(Object(InputfieldForm)) #15 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/ProcessBlog.module(677): ProcessBlog->installWizard(Object(InputfieldForm)) #16 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/ProcessBlog.module(715): ProcessBlog->firstAccess(Array) #17 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/ProcessController.php(204): ProcessBlog->execute() #18 [internal function]: ProcessController->___execute() #19 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #20 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('execute', Array) #21 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/admin.php(85): Wire->__call('execute', Array) #22 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/admin.php(85): ProcessController->execute() #23 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/AdminTheme/AdminThemeDefault/controller.php(13): require('/Applications/M...') #24 /Applications/MAMP/htdocs/ew/ProcessWire/site/templates/admin.php(15): require('/Applications/M...') #25 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/TemplateFile.php(169): require('/Applications/M...') #26 [internal function]: TemplateFile->___render() #27 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #28 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('render', Array) #29 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/PageRender.module(356): Wire->__call('render', Array) #30 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/PageRender.module(356): TemplateFile->render() #31 [internal function]: PageRender->___renderPage(Object(HookEvent)) #32 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #33 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('renderPage', Array) #34 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(411): Wire->__call('renderPage', Array) #35 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(411): PageRender->renderPage(Object(HookEvent)) #36 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('render', Array) #37 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/Process/ProcessPageView.module(171): Wire->__call('render', Array) #38 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/Process/ProcessPageView.module(171): Page->render() #39 [internal function]: ProcessPageView->___execute(true) #40 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #41 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('execute', Array) #42 /Applications/MAMP/htdocs/ew/ProcessWire/index.php(214): Wire->__call('execute', Array) #43 /Applications/MAMP/htdocs/ew/ProcessWire/index.php(214): ProcessPageView->execute(true) #44 {main}</pre>
  22. Hi there, I've tried to install the Blog module for the first time. I have no other related blog pages of any kind. When I try to run the installation wizard, I get the errors below. Any ideas what I should do? Many thanks. BlogInstallWizard: Cannot install Blog pages. Some page names already in use. These are: Blog. BlogInstallWizard: Cannot install Blog fields. Some field names already in use. These are: blog_body, blog_categories, blog_comments, blog_comments_view, blog_comments_max, blog_quantity, blog_date, blog_files, blog_headline, blog_href, blog_images, blog_links, blog_note, blog_summary, blog_tags, blog_small. BlogInstallWizard: Cannot install Blog templates. Some template names already in use. These are: blog, blog-archives, blog-authors, blog-categories, blog-category, blog-comments, blog-links, blog-post, blog-posts, blog-recent-comments, blog-recent-posts, blog-recent-tweets, blog-tag, blog-tags, blog-widgets, blog-widget-basic, blog-settings, blog-basic, repeater_blog-links. BlogInstallWizard: A role called 'blog-author' already exists! BlogInstallWizard: Due to the above errors, the install wizard did not run. Make necessary changes and try again. TemplateFile: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'blog-author-30' for key 'name_parent_id'<pre>#0 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Pages.php(922): PDOStatement->execute() #1 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Pages.php(827): Pages->savePageQuery(Object(Role), Array) #2 [internal function]: Pages->___save(Object(Role), Array) #3 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #4 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('save', Array) #5 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Page.php(1180): Wire->__call('save', Array) #6 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Page.php(1180): Pages->save(Object(Role), Array) #7 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/BlogInstallWizard.php(324): Page->save() #8 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/BlogInstallWizard.php(304): BlogInstallWizard->createRole() #9 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/ProcessBlog.module(2847): BlogInstallWizard->verifyInstall(Object(InputfieldForm)) #10 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/ProcessBlog.module(677): ProcessBlog->installWizard(Object(InputfieldForm)) #11 /Applications/MAMP/htdocs/ew/ProcessWire/site/modules/ProcessBlog/ProcessBlog.module(715): ProcessBlog->firstAccess(Array) #12 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/ProcessController.php(204): ProcessBlog->execute() #13 [internal function]: ProcessController->___execute() #14 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #15 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('execute', Array) #16 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/admin.php(85): Wire->__call('execute', Array) #17 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/admin.php(85): ProcessController->execute() #18 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/AdminTheme/AdminThemeDefault/controller.php(13): require('/Applications/M...') #19 /Applications/MAMP/htdocs/ew/ProcessWire/site/templates/admin.php(15): require('/Applications/M...') #20 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/TemplateFile.php(169): require('/Applications/M...') #21 [internal function]: TemplateFile->___render() #22 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #23 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('render', Array) #24 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/PageRender.module(356): Wire->__call('render', Array) #25 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/PageRender.module(356): TemplateFile->render() #26 [internal function]: PageRender->___renderPage(Object(HookEvent)) #27 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #28 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('renderPage', Array) #29 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(411): Wire->__call('renderPage', Array) #30 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(411): PageRender->renderPage(Object(HookEvent)) #31 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('render', Array) #32 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/Process/ProcessPageView.module(171): Wire->__call('render', Array) #33 /Applications/MAMP/htdocs/ew/ProcessWire/wire/modules/Process/ProcessPageView.module(171): Page->render() #34 [internal function]: ProcessPageView->___execute(true) #35 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(389): call_user_func_array(Array, Array) #36 /Applications/MAMP/htdocs/ew/ProcessWire/wire/core/Wire.php(344): Wire->runHooks('execute', Array) #37 /Applications/MAMP/htdocs/ew/ProcessWire/index.php(214): Wire->__call('execute', Array) #38 /Applications/MAMP/htdocs/ew/ProcessWire/index.php(214): ProcessPageView->execute(true) #39 {main}</pre>
  23. Hi Martijn, Even though I hadn't spelled "method" incorrectly, your suggestion forced me to look very closely at the form. I noticed that the action value was action="/booking" It was redirecting because it didn't have a trailing slash and coming back as a GET Yay!! Cheers
  24. HI Martijn, Nope. I'm a better speller than you It's not that. Thanks for the heads-up though.
  25. Hi there, I have a standard (non-FormBuilder) form on a PW page with its method set to 'post'. When it hits the server, the request method shows 'get'. Suffice to say, there are no post variables and I need them! The form markup looks absolutely fine. The only thing about this page is that its template allows URL segments. Any ideas why this form comes through as a 'get' when it's clearly a 'post'? Thanks.
×
×
  • Create New...