Jump to content

John Kelleher

Members
  • Content Count

    16
  • Joined

  • Last visited

Posts posted by John Kelleher


  1. Very much sold on Processwire (thanks Ryan et al) and looking to supplant various dev stacks with it. Have a local charity needing a system to look after a collection of client records and produce a bunch of reports on how the clients engage with the support services. Basic func. spec:

    • CRUD operations on clients - all fine for PW, I know though if anyone knows of some code/modules to aid in this...
    • Secure logon for limited no users - I know I can do this for the back-end but I'll need much simpler front-end interaction for the users. Is there any way to 'tap into' this back-end login/registration/forget password functionality and expose it at the front-end?
    • To handle custom reporting, I'm guessing I pass form values (using ajax?) to PHP functions that invoke the PW engine to retrieve certain pages.

    In effective, I'm building a simple CRM (can't find a simple-enough commercial one!). Any guidance/assurances on suitability of PW welcome,

    Thanks and thanks for the great work input so far on PW,

    J


  2. I'm creating a site to showcase project work from my students. I know this is a breeze with my conventional SQL database and ASP.NET tooling but hopefully I can work this out in Processwire. Can anyone comment on whether this plan holds water?

    Each Project has:

    • Name
    • Student members (1-4)
    • n photos or videos or audio clips

    Obviously a page with a backing template with the appropriate field types works here. However, the members need to be selected from a separate list of Students. This suggests a PageReference field I reckon and a repeater to handle 1-4 Students.

    I have student details (ID & Name & Programme of Study & Yr of Study) in CSV file so guess I can generate pages from that file to create a collection of Students.

    I may want to filter Projects by 'Programme of Study' (from Student page). Should I create Student pages as a child page of 'Programme of Study' with maybe an in-between parent of 'Year of Study'? I might also permit access to the Project page only to those students who are members. So maybe setting Students up as users is the better way to go?

    I guess I'm looking for guidance around how to implement foreign key relations as you would normally do for a database. I'm guessing there are performance issues around the kind of querying I might want to do but there are hopefully some rules of thumb around establishing relations between entities (pages) in Processwire.

    Thanks,

    John


  3. Just installed ImageInterceptor but getting the following error on rendering:

    PHP Notice: Undefined offset: 0 in C:\CustomerData\webspaces\webspace_00125655\wwwroot\pw.appsolo.com\site\modules\TextformatterImageInterceptor\TextformatterImageInterceptor.module on line 172
    PHP Notice: Undefined offset: 0 in C:\CustomerData\webspaces\webspace_00125655\wwwroot\pw.appsolo.com\site\modules\TextformatterImageInterceptor\TextformatterImageInterceptor.module on line 172

    I have a single image in a body field (textarea), created using CKEditor. I added the image to an Image field and selected that single image in the WYSIWYG editor. The module is installed with no errors. Any ideas?

    Thanks,

    J

    UPDATE: wiped the images from the Image field in the same page. Deleted any references in the body field to the (now missing) image. Then added the same image to the Image field and dragged into the body. Now working. Clue?


  4. @ryan thanks for the followup. I've been busy trying various options with little luck. I think the problem is with the editor - I've tried both TinyMCE and CKEditor. I've tried highlight.js but also syntaxhighlighter. I have noted with CKEditor (using the settings you gave) it strips out the 'lang="php"' attribute that I suspect PBCKcode inserts. Even if I insert it manually, it gets stripped out on saving that page.

    One thing that someone might know about: with CKEditor on saving a code snippet using the PBCKcode popup, the rendered html looks as follows:

    <pre class="prettyprint linenums"><?php echo 'hi there' ?></pre>

    Note the class 'prettyprint linenums' - this is suggestive of prettify.js (Google Prettify) but I'm not using that anywhere, nor have. I'm at a loss where it's coming from!

    Rgds,

    J

    UPDATE:

      I sorta have it working now. Key was to remove the reference to code from the default.css styling that comes with Highlight.js. PBCKcode wasn't inserting the <code>  element after the <pre>. I did have the js invoke code for highlight.js calling on 'pre code' elements but it didn't work. So I changed it to:

                $('pre').each(function(i, e) {hljs.highlightBlock(e)});

    and together with the change in the styling (to just 'pre'), it now works. One small point - it overflows the column without any clipping (bit of a mess) so must insert linebreaks manually to tame it but small price to pay.


  5. @ryan @teppo Thanks guys for weighing in on this. Unfortunately, I'm still getting this. There is some styling happening but not what I'd expect from hightlight.js. I've done the following:

    • all the settings for pbckcode as per @ryan's screenshot
    • have js code in head.inc:
      <script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
    • have css ref in head.inc:
      <link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/default.min.css">
      Also tried:     <link rel="stylesheet" href="/site/templates/styles/highlight.css">
    • have call to highlight.js in foot.inc
      hljs.initHighlightingOnLoad();
    • have my body field for that template using CKEditor (which works) and now PBCKcode showing in toolbar. Added simple php code to the <> modal box but as I say, no styling happening.
    • UPDATE: I have also edited the config.js file in the CKEditor plugin folder as per instructions from PBCKcode.
    • UPDATE: I also added (in foot.inc) the following to target <pre> elements with highlight:
              $(function() {
                  if ($('pre').length) {
                      $.getScript('/site/templates/scripts/highlight.pack.js', function() {
                          $('pre').each(function(i, e) {hljs.highlightBlock(e)});
                      });
                  }
              });

    Should I be providing more explicit styles though I believe hightlight.js just detects the language automatically. This is what I get at the browser:

    <pre class="prettyprint linenums"><?php echo 'test'?></pre>

    I checked @teppo site and didn't see anything like I found there: i.e. lang and class attributes.

    <pre lang="php" class="php" xml:lang="php">

    This looks promising but output is bland courier typeface with no decoration. Thanks for the help. J

    Update: I do see some syntax highlighting in the pop-up PBCK box when editing the field. However, this is lost on browser rendering. 


  6. @teppo: appreciate your taking time while about answering this. I did add pbckcode to extra plugins (sourcedialog already there). I added the changes to config.js for CKEditor recommended by pbckcode.

    I'm also (for the record) using ACF 'On' and Purifier 'On', with regular editor (not inline).

    I <pre>'d the code snippets in the PW CKEditor window. But according to ppbkcode I should be seeing an extra button in the toolbar for CKEditor something like '<>' which would throw up a window to let me pick a language and enter the code snippet. Or is this so?

    You can see the page I'm editing here: http://www.pw.appsolo.com/blog/blog-posts/azure-deployment/

    At the very bottom (away from possible influence of the <ol>), you'll see two lines - one uses <pre> from the CKEditor and the other doesn't. I have the following call to highlight.js in my foot.inc with the following js at the bottom of the page:

    hljs.initHighlightingOnLoad()

    Also, have the following at the top of the page (in my head.inc), this recommended by highlight.js site:

    <link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/default.min.css">

    <script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>

    Appreciate you may be on business so don't let me get in the way of business!

    J


  7. @teppo: Hi, I've gone with your suggestion of CKEditor as there are several different formatting needs (css, php, csharp, html). I've installed the PBCKcode plugin and changed the body field to use CKEditor. I've added the PBCKcode as a plugin on the input field too.

    However, I'm not getting any changes to the CKEditor when editing the field - I expect I should see the <> button to edit the code. Any ideas?

    Thanks,

    J

    UPDATE: Couldn't get PBCKcode to show as extra option on CKEditor. Switched back to highlight.js but seemingly need to prefix code with both <pre> and <code> in that order. Even then, I'm not sure highlight is working - I'm getting the same formatting as suggested by content.css for TinyMCE.

    Surely, this isn't so hard?


  8. @teppo: Thanks for suggesting highlight.js - have it working though it needs <pre><code>....</code></pre> - I can format the snippet in TinyMCE for preformatted but is there any easier way to mark up the snippet with <code> than opening the HTML editor and adding the tags?

    Guess this is a similar problem to adding 'brush: js' with SyntaxHighlighter - something to do with TinyMCE configuration?

    Thanks again,

    J


  9. @teppo TinyMCE shows pre and code in the valid_elements. Also, in the browser I see <pre> before the code snippet. This confirms what TinyMCE shows in the editor - highlighted as per my last image.

    Anyone use SyntaxHighlight by Alex Gorbatchev with success?


  10. @kongondo @teppo thanks but I'm looking to place some pieces of c-sharp or css or whatever into a blog post. I thought just marking it in TinyMCE as <pre> would do the job and there is feedback in the editor that suggests (see image) this works - but it doesn't render as anything but ordinary <p>. I've also tried placing multiple '~' ahead of the code to format it as a code block but no luck. The Markdown Extra seems to work for numbered lists though - I started using the Markdown Extra text formatter since TinyMCE seemed to strip out the numbered list when rendered.

    Image is here: http://www.tiikoni.com/tis/view/?id=f411b49

    BTW: how do I post an image in this post?

    Also, I've just tried to install SyntaxHighlighter but no joy on that front yet.


  11. Hi,

     looking to place some programming code into a page and using Markdown Extra as a text-formatter (only). I've used Markdown Extra elsewhere but none of the typical formatting codes seem to be working. For example, placing a fixed number of '~' symbols before and after text should render that block as code. Alternatively, placing min. 4 spaces before a line has the same effect.

    Does Markdown Extra work properly or is there another way to accomplish placing of code in a textarea field?

    Thanks,

    J


  12. Belay my last - I had set debug to true in my config.php. All well now. For what it's worth, I've spent a long time finding a CMS that provided just enough support but let me play with my html/css/js independently - liking what I see so far. I'm a convert from Kirby & Stacey.

    • Like 1

  13. Thanks to Nikola and Spoetnik for fixing my 404 problems under IIS. I do a lot of work in ASP.NET but I'm growing weary of trying to sort out .htaccess issues in LAMP setups. And those Rewriterules are crazy!

    I still have one small problem that I wonder if anyone has seen. Now that I can get into the admin pages, I find that in the footer of each page there is a lot of debug-like information, although nicely formatted - e.g. Pages Loaded, Sessions, Modules. These are in accordian views and neatly presented but I haven't seen them in the demo or on my MAMP install.

    Would appreciate any ideas.

×
×
  • Create New...