Jump to content

Peter Falkenberg Brown

Members
  • Posts

    347
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Peter Falkenberg Brown

  1. Dear tpr,

    I just tried it again, with the same url as above, with the Richard image, using this code:

    figure {
          display: table;
          max-width: 100%;
    }
    
    figcaption {
          display: table-caption;
          caption-side: bottom ;
    
          font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 0.7em;
          color: #003333;
          font-style: italic;
          font-weight: normal;
    	text-align: center;
    	line-height: 1.2em;
    	padding-top: 3px;
    }
    

    but when I size my Firefox browser all the way down to the smallest possible width, the image and caption are wider than the column, and stick out past the right margin.

    Yours,

    Peter

  2. Dear tpr,

    Thanks... I tried that as one of my first solutions, and while it works, it's not responsive.

    That is, when one resizes the viewport, the image doesn't resize down, probably

    because of the usage of "table."

    At least that's my memory of it, during my testing yesterday.

    Yours,

    Peter

  3. Hi tpr,

    Thanks... Here's a development page:

    http://dev.significatojournal.com/corporate/about-us/peter-falkenberg-brown/

    If you search on the word "Richard," you'll see an image of Richard the Lion Hearted, with the caption below it, with other text overlaying it.

    That image is the only image that I've worked on, on that page. All the other images are either standalone, or in are in tables.

    The code around that image is:

    <figure class="align_left">
    <img alt="Richard the Lion Hearted" src="/site/assets/files/5804/richard_coeur_de_lion.jpg" width="259" />
    <figcaption>Richard the Lion Hearted, Peter's 2nd cousin, 24 times removed ...</figcaption>
    </figure>
    

    The CSS file is here:

    http://dev.significatojournal.com/site/templates/styles/wcp.css

    The CSS in use for the figure is:

    figure {
          position: relative;
    }
    
    figure img {
          max-width: 100%;
          display: block;
          width: auto;
          height: auto;
    }
    
    figure figcaption {
          position: absolute;
          width: 100%;
          max-width: 100%;
          font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 0.7em;
          color: #003333;
          font-style: italic;
          font-weight: normal;
    	text-align: center;
    	line-height: 1.2em;
    	padding-top: 3px;
    }
    

    I also tried using nested divs, with position relative and absolute, and got the same behavior, with the caption text being overwritten.

    My impression is that the parent div (or figure) needs to have a height attribute that includes the height of the caption, so that text wraps around the caption.

    Without that height value, the caption, which is absolute, can't have text wrapped around it.

    The primary issues are:

    - there is more than one image with captions on the page

    - as the page is viewed in responsive devices, the image sizes will scale down, and thus the caption widths *and heights* need to scale as well, and thus the image sizes are not known in advance, and will change.

    ... and, the images on that page are a mess, because the prior hard-coded table widths are conflicting with the new responsive design.

    Thanks!

    Peter

  4. Dear PW Gurus,

    I'm having loads of fun upgrading to PW 2.7.2. I love it. I'm also using the CKEditor now, instead of TinyMCE, and in my newly reworked responsive website (using PocketGrid), I've run into an issue with image captions.

    To scale images responsively, I'm using the max-width: 100% directive, which works fine.

    When I place a caption, using PW and CKEditor, the figure / figcaption works very well...

    ... EXCEPT when the caption is very long. I use float: left or float:right on my images. With long captions, the text extends way past the width of the image.

    - So, I messed around for hours, with CSS options, using both figure/figcaptions, and nested divs.

    I was able to get the long captions to adhere to the parent image width once I used CSS settings for position: relative on the parent, and position: absolute on the caption div.

    However, with that, the caption div was overwritten by the surrounding text.

    => So, it seems that the only way available is to reset the height of the parent div (or figure) of *each* of the multiple images on the page, whenever the browser is resized and/or loaded (or used with different devices), by using some type of JQuery function to click through all of the images that have a certain class.

    But... after extensive Googling, I haven't found that routine, or plugin.

    Does anyone have any pointers to finished code, or any thoughts? I'm not a Javascript or JQuery person.

    I was surprised that I couldn't find dozens of answers about this, given the importance of responsive design and the usefulness of captions.

    Thanks!!!

    Peter

  5. Dear Beluga,

    Looks like a good app.... but then again, we have PW!

    I think that someone could set up a cron job to look for new GitHub, blog, or news posts, and feed that data

    right into the "PW Function List" application, so that it would always be up to date.

    Just a thought...

    Peter

  6. Hi All,

    Back in 2013, I spent a great deal of time sort of getting up to speed with v2.3.0, and built three major web database applications with that version (as well as some magazine style websites). Soma's CheatSheet was invaluable, as were the doc pages and the forums.

    I stayed with v2.3.0 for a variety of reasons, for far too long, but now I'm digging in again to ramp up with the newest versions.

    I've read through some of the discussions about the difficulty of spending the time to document things, (we all know that reality :-)), so I'm wondering if the ideas below might be useful, in the interim. I hope I haven't missed forum posts where someone already covered this. :-)

    * It seems to me that we have a significant amount of documentation already, but it's hard to dig through. Sources I see are:

    1. The GitHub technical notes on each new feature, function, etc. Looks like versions newer than 2.3.0 started around page 22:

         - https://github.com/ryancramerdesign/ProcessWire/commits/dev?page=22

         - Can all of these tech notes be exported into a more readable format? For example:

              . a huge Word doc, or better yet:

              . a series of browsable, searchable PW pages, where each page is tagged with the PW version and the function names covered in the note

    2. Ryan's blog pages and Teppo's Newsletter pages:

         - http://processwire.com/blog/page3

         - http://weekly.pw/issue/1/

         (looks like PW was at 2.4 at the beginning pages of both the blog and the weekly, so there's a bit of a gap

         - Perhaps the blog and and weekly pages could be tagged with the same values: the PW version and the function names covered,

              so that the GitHub List could contain links to those pages.

    Essentially, I'm suggesting that we start with a list of new features and functions, etc, tagged by version, that would serve as an index of what's new since 2.3.0, which I believe is the version that the Cheat Sheet covered (not sure about that).

    Then, if someone has the latest version, one could assume that all the functions in the list are relevant, and it's simply a process of then browsing through the index list and clicking over to blog/news pages for more info, or searching the forums for more info.

    => The main point, as I see it, is that an index like this would give us the list of what's new, as the starting point.

    Without that, we don't even know what to look for, in terms of new features, functions, etc.

    I would think that the very first step would be the export of the GitHub tech notes, into a PW set of pages,

    followed perhaps by a simplified outline / index / table of contents list of all the major new functions and features.

    Any thoughts?

    Thanks to all!

    Peter

  7. Hi All,

    I've finally! installed v2.6.1 on a dev site, and will be making it live on our magazine site soon, after I finish a new responsive deployment using Pocketgrid.

    I've been reading the weekly newsletters with great interest. PW just keeps getting better and better!

    Just wondering: Is 3.0 the next production version of PW, after 2.6.1, or will all the great new changes since then get released in an interim version, like 2.7? Any idea when that might be, etc?

    I don't really want to install a development version on my live site, but the new changes since 2.6.1 look really tasty. :-)

    Thanks to Ryan and All for making PW such a truly flexible and powerful programmer's CMS. It's a joy to work with.

    Peter

    • Like 2
  8. Hi All,

    I'm creating a PHP / PW bootstrap script that I'm running from the shell prompt, that will create Linux web accounts and databases.

    The script pulls data on each account from a PW application, and runs through error tests, and then uses ssh -e commands to run the Linux commands that do the work on various remote servers.

    One thing that I'm not sure of is exactly how long the script will take to run the linux commands, between each database select account operation. I want to make sure that the PW $dbh connection doesn't time out, in between. Of course, it might not timeout -- I'm just not sure yet.

    Is there a setting that I can tweak to allow persistent connections (assuming that I can close them properly)? Or a setting to tweak the timeouts (besides the /etc/mysql/my.cnf timeout setting)?

    If it were a non-PW script, I could reconnect to the database on each account (using an array of previously gathered IDs, to click through), but my PW script simply starts off with the bootstrap include statement at the top, so I'm not sure how to do a reconnect.

    Any thoughts or recommendations? I've read some posts about modifying the core, but I'm hesitant to do that.

    I'm using PW 2.3.0 (can't upgrade at the moment), on Linux CentOS, with Percona MySQL.

    Thanks!

    Peter

  9. Have you tried this? Maybe it's not the $page object which got messed with. But if you don't override $page or $pages this shouldn't happen. 

    $page->save();
    

    Of topic: Maybe think about updateing pw. The current stable version is 2.5.3, with lots of great new features.

    Yes, I've tried with $page->save() with the same result.

    My code to save or delete the other pages is specifically using a different variable for those page objects,

    so I would think that there shouldn't be any conflict.

    I wonder, however, if in the internals of PW code there's a variable conflict, i.e. in the processing

    of the other pages, some code uses the $page object.

    I can't upgrade with this particular application because of client requirements.

    Yours,

    Peter

  10. Hello PW Gurus,

    I'm stuck on a strange symptom. I've created a routine to edit and update a page of values via a form and the api.

    Part of that routine is to add and/or delete child pages of a different page branch.

    When I run through the edit / update and use the code:

    $pages->delete($domain_ip_former_page_child_page, true);
    

    and then further down, do a:

    $pages->save($page);
    

    the currently selected values of the primary page do not get saved. Somewhere between selection of the values and the save command, the $page object loses the selected values.

    When I comment out the delete command, the primary page saves correctly.

    Also, the delete command (when used) does successfully delete the child page in question.

    I get the child page with this code (ignore the line breaks):

    $domain_ip_former_page_child_page = 
    $pages->get( "parent=$domain_ip_former_page_url, account_id=$account_page_account_id, 
    include=hidden, $skiptrash" );
    

    I just can't figure out why a page delete command would mess with the values of the current $page object.

    Anyone have any thoughts?

    Edit: I'm using PW 2.3.0.

    Thanks,

    Peter

  11. Something like this would probably work:

    // find free ip's
    $selectable_domain_ips = $pages->find("parent=/domain_ips/,server_id=$page->server_id_select, include=hidden, account_id=");
    // add currently selected one to the list
    $selectable_domain_ips->import($page->domain_ip_select);
    
    return $selectable_domain_ips;
    
    It seems you've got a two way relation here - or do you really? For this to work you'd have to take care of (un)setting account_id of domain_ip pages yourself. If you've got that set up and working already you should be fine. If not, I'm sure someone here will help you get there (or suggest a whole another approach to make it simpler). I'm a bit rusty myself not having done anything with PW or PHP in months.

    Hope this helps. :)

    Dear Nik,

    That did the trick! Thanks!

    I think my stumbling block is that I've come from the Perl / PHP procedural method of coding, and I've not taken adequate time to truly digest the PHP OOP model. So, I run into knowledge gaps with things like objects, etc. Learning  OOP PHP is on my todo list.

    I'm not using the admin interface to run this app -- at least not the part above. So, I'll be including code to update the account_id field in the domain_ip data record, after someone selects and saves a selected IP.

    By the way, I saw a note from Soma about PW v2.3 being buggy and needing this code in the above custom PHP field:

    $p = $pages->get($_GET['id']);

    But... with your code above, I don't seem to need that.

    Do have any thoughts on that?

    Thanks again!!

    Peter

    • Like 1
  12. On the other hand, if you don't need native pagination for the results of this kind of query (and there won't be too many results!), you could use something along these lines:
    $results = $pages->find('fieldA=xy');
    $additionalResults = $pages->find('fieldA=z, fieldB=x');
     
    // this leaves no duplicates to the PageArray
    $results->import($additionalResults);
    

    Dear Nik,

    I'm using PW 2.3.0, and am having the dickens of a time to get something like this to work in a page select field

    using the "Custom PHP code to find selectable pages" snippet field, for a select list field called:

    domain_ip_select

    The field is in a template/fieldset called 'accounts', and references a second template/fieldset called "domain_ips" as the list source.

    This works fine and returns all records with the same server_id as the parent account data record.

    $p = $pages->get($_GET['id']); 
    return $pages->find("parent=/domain_ips/, server_id=$page->server_id_select, include=hidden, sort=domain_ip");
    

    but, I'm trying to get two sets of results for the query, based on whether or not the selectable domain_ip pages have an account_id field that is:

    - blank, or

    - matches the account_id field already in the edited record.

    (i.e. I don't want to see a domain_ip that is already taken by a different account, but I DO want to see the current domain_ip for the current account.)

    I tried this, but it didn't work:

    $p = $pages->get($_GET['id']);
    
    $pages->find("parent=/domain_ips/,server_id=$page->server_id_select, include=hidden, account_id=$page->account_id");
    
    $pages2->find("parent=/domain_ips/,server_id=$page->server_id_select, include=hidden, account_id=");
    
    $pages->import($pages2);
    
    return $pages;
    

    I'm assuming that my syntax is incorrect in the second example, but I've hit a wall with my knowlege gap.

    Thanks for any help!

    Peter

  13. How about ip_type.title?

    Dear Arjen,

    Zowie! Works perfectly! Thanks!

    Note that with the concat syntax 'ip_type.title', the exclamation mark for formatting doesn't work.

    But I don't think it's needed anyway.

    Ryan, this would be good to add to the module notes.

    Thanks again, Arjen.

    Peter

  14. This is exactly what I was looking for! Thank you :)

    I'm using it to create a custom "Label Field". However, it shows the ID, versus the title. Is there something I need to do to get it working when concatenating fields of the Page fieldtype? Or does it only support certain fieldtypes, like Text?

    Dear Ryan,

    I'm having the same issue as Lauren. I'd like it to concatenate the select value of a page type field.

    The field is 'ip_type' and what shows up is the id of the page (e.g. 197), rather than the text value of the page (e.g. 'dedicated'),

    which I've placed in a field called 'select_value'.

    I also tried changing the ip_type field to use the 'title' field instead of select_value, but there was no change.

    Thanks,

    Peter

  15. Dear Pete,

    Here you go guys: https://processwire....plates/?p=22762 (found via a link halfway down this article: http://www.flamingru...in-processwire/ )

    I know ryan has explained this several times over the years but I agree that as one of the real "what the heck?" points that come up when you're first exploring ProcessWire some page dedicated to it on the site and linked to wherever fields are mentioned might not be a bad idea :)

    That's a helpful post; thank you. In fact, I think I read that before.

    I think that a more comprehensive post with benchmarks and every possible advantage to the one-field-per-table method, pointed at both techies and corporate types, would be even more powerful.

    Yours,

    Peter

    • Like 1
  16. Dear Ryan and All,

    Ryan wrote: You do have to come from the point of view of "I want to create and have the system adapt to me" rather than "I will create something based on what the system provides." If you already know what you want to create and it's something unique, you won't find a simpler path to get there than PW. ... Our audience consists of those that want to have a system support their original creation rather than mash up an existing creation.

    The above quote is what brought me to PW, and what makes me stay.

    I've built three magazine style "CMS" sites with ProcessWire, and it was a joy.

    But I've also built an email-driven, web help ticket system, as well as an entrepreneurial, formula-based business application to vet new startup concepts. (Both apps are non-public, user-login-only apps.)

    Once I understood ProcessWire's methodology and API, I was free to focus on the design and implementation of the above custom business applications without worrying about ProcessWire getting in the way -- because it didn't. I wrote PHP template scripts with the API, using the page-based methodology, and it was a dream come true.

    I shudder at the idea of trying to replicate the above web database applications in WordPress or Drupal. Someone probably could, and they're welcome to it -- but it "ain't me." :-)

    Also: I've probably missed a post that you've already written, but do you have a post that thoroughly explains the benefits, virtues and rationale behind using the "virtual table method" PW employs, by stitching one field per real table into field templates?

    I'm comfortable with it now, but for folks who are used to regular data tables, with a set of fields in them, PW's method is very new and very different. A prominently placed white paper on that would be very helpful, I believe.

    Kudos, Ryan!

    Peter

    • Like 13
  17. Dear All,

    If one defines "Enterprise" as an environment of mission-critical websites that make money for a corporation, then I am already using ProcessWire in that fashion.

    My day job is as a Web Director for a New York magazine publisher that owns around fifty+ magazines. We have over 25 Linux and Windows servers, which I manage. I also write custom web database applications for the company, and recently wrote a "Web Help Ticket System" using ProcessWire. The ticket system receives its initial input via email, which gets piped to a PHP script, parsed, and then input into the ProcessWire help database. The script then emails the responses to various individuals that are in the database.

    I've created a front-end staff interface, with usernames and passwords, that displays the tickets and allows editing, searching etc.

    It's been running for a number of months, with tickets sent in from Editors, etc. So far, it's proven to be very robust.

    This is just one example of what I would call an Enterprise level web application, built using ProcessWire as the CMF. Of course, someone else may define it differently.

    I want to note that I had initially looked at Drupal for this purpose. I'm not yet a "Drupal developer" -- I just haven't spent enough time with it. But after spending *some* time with Drupal, and after seeing that many magazine sites that use Drupal seem over-heavy and bloated, I have to say that ProcessWire is lean and mean and fast and a complete joy to work with. It does have a learning curve, but I think it's less than Drupal's learning curve. (That would be a good survey.)

    I say that because once you wrap your head around PW's method of one data table per field and its "virtual data tables" (aka templates or field sets), then it becomes a piece of cake to use the API and PHP as the template language. The sky's the limit in terms of ProcessWire's power and flexibility.

    PW might seem arcane at first, but I don't really think it is, except for the table structure, and that ends up making sense after one digests it.

    I also built a complex, formula-based business app with PW, at http://thepivotstartup.com (in the members section). It allows entrepreneurs to plug in numbers about their business ideas and vet them, to see if they might work in the real world.

    Finally, I use ProcessWire as my own CMS, at http://significatojournal.com. My wife, who is a writer, but non-technical, does most of the article posting, using PW's admin back end. She finds it very simple to use. I don't need ProCache yet, but when I do, it seems to me to be a brilliant caching mechanism, since it dynamically writes each generated page to flat HTML files, and then uses clever .htaccess rules to serve them up.

    Because of all of the above, I would recommend ProcessWire for mega websites, and in fact, if it was "my do", I would build and/or convert many of the magazine sites that I manage in my day job to ProcessWire. I'm completely confident that PW would do as good a job as WordPress and Drupal, which the company currently uses.

    I believe that the reason that PW hasn't been adopted in the enterprise isn't support, but rather the lack of market share, mind-share, and enough usage for Big-Iron websites to prove to companies that they'll be safe using PW.

    I don't think Enterprise support is really the issue. We had one CMS, called "Nstein" and another called "Ekron" that both had expensive support packages. We left both behind with great sighs of relief. We use Drupal, WordPress and DotNetNuke, without any support contracts. All that matters is the confidence that:

    a) we can find developers who use it, and

    b) there are enough examples of high-powered, high-volume, Big-Iron sites that use it successfully.

    I think "B" is the real kicker. I read a Fast Company article about Drupal serving up hundreds of thousands of pages, and then recommended it to our VP. But, I wish PW had been around back then.

    That's the PW challenge, I think. Convince some VERY high-level, well know companies to make huge, heavily trafficked websites with PW, and then other folks will say, "Hey! Look at that! Let's use ProcessWire!"

    :-) And then it shall be done.

    Peter

    • Like 15
  18. Hi All,

    I'm changing the section url of one my sections at the Significato Journal, and I'm stuck on getting the .htaccess syntax to work.

    I've tried adding this to the .htaccess file, just below the "redirect to www" section (which I'm not using) --

    RewriteRule ^/columns/culture-of-heart/(.*)$ http://significatojournal.com/columns/culture-of-kindness/$1 [R=301,L]
    
    I also tried adding a slash before the $ in the source, i.e.
    
    RewriteRule ^/columns/culture-of-heart/(.*)/$ http://significatojournal.com/columns/culture-of-kindness/$1 [R=301,L]
    

    Neither worked. When I change the url of the section from 'culture-of-heart' to 'culture-of-kindness', and then enable one of the rules above, and then click on an article page, e.g.

    http://significatojournal.com/columns/culture-of-heart/the-omnipresent-embrace/
    

    it fails with a page not found. (Note that currently, the old url is still active, so you won't see an error.)

    Does anyone have any suggestions about the syntax? I don't want to have to create 301s for all of my essays under that section, and would rather use rewrite magic.

    Thanks!

    Peter

  19. Dear Horst,

    Thanks for this tip. I had read the post by Hari, and Ryan's response.

    It seems to me that the reconnect to mysql code would come in handy, but it also seemed that it

    was meant for situations where there was quite a lag between commands, like with thousands of

    records being processed.

    In my case, it was happening with load balancer hits against the index page.

    Also, my version of PW didn't have the file 'WireDatabasePDO.php'. It just had Database.php.

    But... your post, and Hari's comment on the GitHub page, https://github.com/ryancramerdesign/ProcessWire/pull/366,

    stimulated my little grey cells, so I went and looked at the wait_timeout value.

    It was set to 30 seconds, and the load balancer checks every 30 seconds, so I thought that might it.

    So I raised the value to 300 seconds.

    I'm hoping that will fix it. Crossing my fingers.

    Thanks for your help!

    Peter

    • Like 2
×
×
  • Create New...