-
Posts
326 -
Joined
-
Last visited
-
Days Won
5
Everything posted by BrendonKoz
-
This is likely more of a pro module type of thing, but I feel one area that ProcessWire is lacking from other comparable offerings out there is a site theme that is extendable and customizable from the admin backend. Tying a site-profile to the architecture of the site makes sense due to how PW is built, but being unable to switch a theme (even if temporary, to preview what the same content on a site might look like under a different skin), stylistically, after a site-profile is chosen is a little lacking. Even as a developer I like the ability to change things up now and then, but we don't really have a built-in way (that I'm aware of) a way to alter the frontend CSS via the backend using a known definition of basic templating to create themes. We can create one-off site-profiles, but not reusable themes. Maybe @bernhard is getting there with RockFrontend(?) as a third-party offering, but it would be nice to see some way that this could be supported from a (potentially optional) core (or pro) module. Similarly, I think it may be a good idea to start seriously considering alternatives to our richtext editor. I don't mean actually switching, I literally just mean considering. We switched back to TinyMCE because the newest version of CKEditor was no longer handling data in a similar way and it wouldn't be backward compatible, but TinyMCE is still handling data in the same way, but then after we switched, the company that now owns TinyMCE enacted a new licensing scheme. Although they're allowing an opensource license for now, that may not be the case, longer-term. Having a core proof-of-concept alternative (however the data is structured) would be lovely. No one wants to be caught off-guard! ? 3.1 or 4.0: If only updating the core to support PHP 8+ capabilities, a 3.1 nomenclature sounds good. If in the process of doing that there were additional and significant enough updates applied, maybe a 3.5. If attacking even more functionality, then a 4.0 seems reasonable. ?
-
[SOLVED] How do you work with blockquote captions in TinyMCE?
BrendonKoz replied to howdytom's topic in General Support
Not entirely helpful, but I use a Combo field to hold my blockquotes. I also wanted to make sure that there could be an optional cite available with the blockquote. Although there are plugins and adjustments that could be made to a WYSIWYG editor, they don't always transition easily from version-to-version, or from editor-to-editor. For scenarios like that, I prefer future-proofing it and going with a potentially less user-friendly interface, but one that likely won't break. An alternative that you could use, if you didn't want to find a TinyMCE plugin for this, could be to use Hanna Code. I'm guessing you don't want anything that looks like code of any sort, but shy of a button, it would definitely provide you the ability to keep things within the TinyMCE field and still render a blockquote (with optional cite).- 2 replies
-
- 1
-
- blockquote
- caption
-
(and 1 more)
Tagged with:
-
My test site just printed some content: what next?
BrendonKoz replied to Ade's topic in Getting Started
What @da² mentioned above is kind of what I was thinking too, so I don't think he meant harm by it. You pointed out your comfort with HTML and confusion on multiline PHP, so the points are there for us to create an assumption. Apologies if it's wrong! ProcessWire is a content management framework, so it does require some level of understanding of development on both a higher and lower level, or at least the ability to read through code - it took me until just this year to realize that a lot of the documentation are actually in comments in the code, or in Markdown files that developers provide with their modules. I felt (partially) silly for only ever trying to look at written documentation. Like you, I love examples too; much of which exists in the forums, honestly. Anyhow, that being said, I may not be the best person to provide a response, but I do want to try to help you out here. The problem with these questions though are that each and every one can begin the response of the answer with: "It depends." Typically each template is not an entire HTML document, as you'll have one (or two) main layout file(s) that then get merged with your template in one way or another. This would depend on your output strategy as linked above. Since you're just starting out, it might make the most sense to give Direct output a try so that you can start to understand how ProcessWire works. I'm assuming though, since you read through the documentation, you'd also read the last part on the direct output page that mentions its drawbacks (I assume this based on question #3 above). Part of the solution to this, with direct output, is understanding the ProcessWire API. You can retrieve any "page" or page content within the system from pretty much anywhere by using the API. It's extremely powerful. Depending on your needs, you'd likely need to do some manipulation on the returned data prior to rendering it as HTML, but the point is that it's accessible to retrieve. This will depend on your own imagination on how you want to build your site profile out. If you've got some time, you might want to setup some test ProcessWire sites, and install some pre-made site profiles that you can examine and look through to understand how each developer decided how to set things up. There's no real right way to do things, and a lot of it will depend on the project's needs and requirements. Sure there are better ways to do things, but a lot of us don't figure that out until after we've made the not-better solution first. ? As a partial example to this question though - let's say you have a very simple blog. You have two system templates (thus far) - one that lists all blog posts, and one that views a specific blog entry (post). You have four template files: (1)header.php, (2)footer.php, (3)blog.php, (4)post.php. Posts are children of Blog, and Blog is the parent of Posts. (You could consider "Blog" as the homepage I guess in this very simple example.) Your header and footer contain your site's template, split up as expected. The blog.php and post.php files include the header and footer. (We won't worry about navigation at this point, this is a simple example.) The Blog template file uses the API to find and retrieve all Posts, or its children. It then outputs the title, as a hyperlink, to the blog post itself. (This could be adjusted to make sure entries are chronological - normally it would likely retrieve them that way, but depending on how you develop the system that might not always be the case.) if ($page->hasChildren()) { echo "<ul>"; foreach($page->children() as $post) { echo "<li><a href='$post->url'>$post->title</a></li>"; } echo "</ul>"; } The Post template file wouldn't need to know about any other pages; its purpose is to display the content contained for its own page. Surely it can though - it could display next, previous, or related posts. Again: The API can help with those scenarios (related would likely use tags or categorization of some sort). So when someone visits the post, as linked to from the Blog, the post.php file would use fairly simple PHP to output its own content. Let's assume the post system template has 3 fields: Title, Summary, and Body. The Blog excerpt above only shows how to loop through its child pages to output links, the Post excerpt below will have a bit more HTML just to hopefully provide more context. <h1><?= page()->title ?></h1> <div class="blog-summary"><?= page()->summary ?></div> <div class="blog-story"><?= page()->body ?></div> Remember, content above and below are handled by the header.php and footer.php files that are included in the post.php file, in this simple example. I could've added it above, but, well...oops. ? Are you asking about an HTML region, or a ProcessWire markup region? Verbiage with ProcessWire can get a little confusing, so I just want to be sure. Assuming you're just asking about some random area of HTML content on a page getting dynamically loaded from other areas of the system - you'd use the PW API. So let's say you want to get the title of the current page from the header.php file, which is a template file, not a (PW) system "template", so it doesn't have its own PW "page" fields, it's just a file. But you can still use the PW API to query all pages, get a resultset, and then process that data to output what you want. You've seen the children() method above. You can also use the pages()->get() method to retrieve the site's root homepage, which can be referred to either as "/", or 1...so that would be $homepage = pages()->get('/'); or $homepage = pages()->get(1);. From there, you can use the return value in $homepage and then find its children. You now have a first-level for your navigation links, if you decide to setup your navigation based on the tree structure of your site (you don't have to). I can't say whether this is any more helpful or not than other forum responses, or examples in the docs. Generalized questions are really hard to answer simply because there are so many ways to come up with a solution and a lot of it depends on many various factors. -
Since this is a local database configuration we're discussing, don't forget that you are the administrator of your own development environment, so another possible solution would be to just create another (different) database user on your MAMP server, and give it access to your project's database. Since it would be a new user, you can choose whatever password you'd like. Then just update the config.php file with the new user's credentials.
-
upgrade Blank Page after upgrade from Version 3.0.62
BrendonKoz replied to BIMAQ-Admin's topic in General Support
Apologies for the confusion - my response was a bit generic since other people do visit topics like this for reference in the future. A blank page, with PHP, (especially when view-source also is blank) is typically indicative of a server-level PHP error - and if PHP is being used to redirect that error to an application's log file, if it fails before it can redirect the logging to that custom location, then you'd need to check the server's error logs. I mentioned both for thoroughness, but in your case since you didn't see any errors in ProcessWire's error log file, you'd want to check your webhost's server's logs. The question about the response being 200 - that's the HTTP response code. You can check that in the browser's developer tools. You can see it under the "Status" column of the Network tab in both Firefox and Chrome browsers. I suspect it's a 500 (error) response, and if it's not sending the error to ProcessWire's error log, the error messaging should be located either under your server's webserver error logs, or if separated out, your webserver's PHP error logs. I would check there. I wish I could pinpoint exactly what the problem is, but like Jan mentioned, the upgrade process rarely fails so it's hard to know for sure. -
upgrade Blank Page after upgrade from Version 3.0.62
BrendonKoz replied to BIMAQ-Admin's topic in General Support
Getting stuck like that is not fun! Hopefully we can help you out. First though is a little self-help question: Have you referenced all of the steps from the following page? https://processwire.com/docs/start/install/troubleshooting/#troubleshooting-upgrades I suspect there's some sort of error being generated and either debug mode is off (due to the website being in production) so you can't see the messages by default, but the error messages should be in one of your log files, or in your server (apache / php) error logs. -
Because you're referencing the image dynamically, it's hard to say what it should be here. What you can do though is, if you have the Tracy Debugger module installed, do a few db() calls on $content to try to identify what is actually contained in the value you're retrieving within $link. Try $content, $block, $content->$block, etc. I suspect that you are just not referencing the correct object name, but since you're calling things dynamically, you'll need to do some debugging of your own to figure out what's going on.
-
Have a safe road trip! Make it a memorable drive back with your daughter, too, and enjoy the weekend! Thanks for the suggestion on the time fix, @bernhard! I'd seen it a bunch of times but never realized it was a mismatch. Good catch! Looking forward to checking the commit logs, especially for the InputfieldTextTags.
- 1 reply
-
- 4
-
- 242 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
It doesn't break, or negatively affect the other module now, does it? ? You've been struggling with this for awhile - glad you've made significant progress (and maybe completely solved it)! flydev definitely deserves the credit aside from yourself though, imho. ?
-
When I was adjusting the Page's editable, listable, viewable, and addable method hooks, I was testing access for one to determine access to another. This caused a bit of a recursively confusing mess. You aren't by chance doing something similar, are you? If so, different calls of the same method can/will return different values due to context, and data that either is, or hasn't yet been set (typically access to templates in my case).
-
Does it have the same end result if, on your dev environment, you have debug disabled? (I'm assuming the dev environment has debug enabled in this instance.)
-
Has your server admin gotten back to you, @celfred? I'm curious if you were able to resolve this. I do think a lot of the issues may have been between the DB Session handler and your host's configuration, but (obviously) it is not just that. Would love to know if you had found a solution.
-
When I had a similar situation and huge variants in image dimensions, I solved this a different way by moving a logo "section" from a page block to providing a full page that is dedicated to partner/sponsor organizations. It enabled me to provide the organization name (which isn't always immediately evident from just a logo [for people; bots would have indexed the ALT text just fine]), the website address (so if someone saved an image of the page the website location still exists), and a short summary description of the organization - which could be anything: how they've partnered/helped, a description of their organization, a pulled meta description from their website (if available), etc. I could display all of them at once since it was a dedicated page, I could decide to order them alphabetically, by level of sponsorship, or randomly, thereby removing unexpected bias between the sponsors (or at least defending the decision), and although it wasn't necessarily quite as nice as having a clean block of images to separate out content on the prior page, it did clean things up when it had its own dedicated space - and the original image section became a call-to-action area to link to the dedicated page. It allows a bit more freedom for design options, too.
-
FieldtypeMapMarker default address not working
BrendonKoz replied to DrQuincy's topic in Modules/Plugins
From the module's support forum topic, it seems as though there's an outstanding issue at the moment, and an update to the module is needed due to changes behind the scenes with Google. I tried installing the module and testing it out quickly to see if I could reproduce the issue, but my API key/account doesn't have billing enabled, which is required, so I unfortunately couldn't provide more insight than the link to the forum topic. -
New post – Implementing and using TinyMCE 6 in ProcessWire
BrendonKoz replied to ryan's topic in News & Announcements
Thanks @szabesz, I should've quoted that part like you did, that would've been more meaningfully useful than what I provided. ? -
New post – Implementing and using TinyMCE 6 in ProcessWire
BrendonKoz replied to ryan's topic in News & Announcements
From the comments of the linked article, there was a link to this information which covers end-of-life for v6, as well as the ability for open source projects to apply for a separate license for v7: https://github.com/tinymce/tinymce/discussions/9609 -
Mysterious 404 GET request favicon.ico that isn't in templates?
BrendonKoz replied to hellomoto's topic in Security
All browsers request a /favicon of some sort (.ico, .png, .gif, etc) - it's the icon that shows up in your browser's TAB to identify the website at quick glance. It may not be required, but you will always have a request, and if you don't include one, you'll also always get 404 errors in your webserver log files. There are other files that browsers will automatically request. I often use a webservice to take care of (most) of them at once, such as https://realfavicongenerator.net/. Older browsers/devices may still request files that this service no longer generates for you, but thankfully those requests will slowly fade with time. ? -
Honestly, the fact that PW does not require composer is a selling point for me. I develop on multiple hardware, depending on where I'm at (home on my gaming machine, at work on a business class PC, or on my 2011-era Macbook Air) - all running a Docker-based solution with shared file access to a Dropbox instance (in other words: very slow access to host OS files in the virtualized host OS). It took well over an hour for my Macbook Air to finish its composer install of Statamic. When the non-composer version of it was available, it took a little over a minute to unpack everything. There are absolutely massive benefits to standing on the work of others who have come before, but the massive inclusion of unnecessary code also exists (and @wbmnfktr already mentioned the additional attack vectors and need to keep things up-to-date, and how things can break from dependencies). I'm always concerned with one small included library in a composer setup getting a repository pull request from a bad actor that gets accepted...and then any/all platforms that use that little library (and keep up-to-date) are now essentially, unknowingly, vulnerable. I'm glad that ProcessWire offers both options. Having a composer option is awesome. When solutions don't offer a simple alternative to composer, it just sucks (for me). I wish I had more to provide in terms of similar CMSs to compare to ProcessWire, but the only ones I'm aware of, and I don't even entirely consider them all too similar, have already been mentioned. ? Some features of Grav CMS, maybe, are comparable in terms of its intention for customization.
-
Hi mel47, if you haven't yet figured this out, I think we might need a bit more information in terms of what capability your templates have - like, are there any page reference fields that could reference other pages? What page, or pages, do you want the members listed on? Since you're mentioning regions I wasn't sure if members are listed on every page, or just specific choices. When you mention "member/awardee template", are you referring to a ProcessWire template assigned to a page type, or a PHP file (template), because I got confused when you asked if you should use the member/awardee template and render it in basic-page which is itself a ProcessWire page template...and if you did intend to render an entire page's output inside another template (i.e.: basic-page) then that would seem you wanted members included on quite a few pages.
-
My only concern with using a JSON solution is, through my experience on Dreamhost and going back and forth with disabling mod_security for various issues, I noticed that Apache sometimes logged that it delivers the HTTP request, whereas if it's a PHP include/require or database query, it's all going to be run on a single PHP process (unless explicitly coded otherwise). If using JSON since Apache is handling a separate request, I think it has the possibility to spawn/create another PHP child process. Under normal scenarios this isn't a problem, but if you start getting hit with a bot attack of some sort (dictionary attack for wp-* pages, or DoS, or just a lot of 404s from a web scraper using old data [thanks, AWS]), you'll be increasing the spawn rate of PHP child processes much more quickly for any pages requesting data externally, and possibly hit a limit. Obviously caching can alleviate a lot of that - if you've taken the time to implement it. Just something to (possibly?) keep in mind. Realistically if you're getting attacked you'll still likely hit a limit eventually. ? Since many of us like cheap hosts... ?
-
If you prefer one-liners: <?php // https://processwire.com/api/ref/wire-array/each/ echo $pages->find('template=faq')->each("<div><h2>{question}</h2>{answer}</div>\n"); ?
-
After enabling it, you'd then need to add it. I copy/pasted your plugin's code into a file in my test PW site, followed my steps, but then also added it to the list of items in the toolbar. It (unfortunately) doesn't show up as a suggested item, so you have to type it manually and make sure you don't misspell it. Afterward, it should be enabled on your configured field(s). My field's Tools Menu is disabled, so I didn't test against that, but it does work, at the very least, for the toolbar/icon area when added.
-
Neat! I like the readability score - it provides some useful context back to the authors. I was originally looking to see if it'd be possible to integrate the hemingwayapp(.com) interface as a field for similar reasons, but gave up. I instead just created a "Estimated Reading Time" field for site visitors as a feel-good (for me) feature. (I'll share it in case it's useful. The $page->reading_time is a hidden integer field in the template.) Multilingual sites could use the referenced source study to define times based on available data. <?php // ready.php // Blog/News Post Page - set reading time $wire->addHookBefore('Pages::saveReady(template=news-post)', function(HookEvent $event) { // Get values of arguments sent to hook (and optionally modify them) $page = $event->arguments(0); // Get the word count of the summary and body fields (combined) $summary_word_count = count(wire('sanitizer')->wordsArray(strip_tags($page->summary_textarea))); $article_word_count = count(wire('sanitizer')->wordsArray(strip_tags($page->rte))); // Set the value for the reading time field (number) based on word count // To provide a range, a text value would have to be returned (and stored), but is possible by calculating cpm, // wpm_top, wpm_bot and determining variance // Source Study: https://iovs.arvojournals.org/article.aspx?articleid=2166061 $cpm = 987; // average characters per minute, for English $wpm_bot = 161; // English values for reading speeds $wpm_top = 228; $wpm_ave = ceil(($wpm_bot + $wpm_top) / 2); $page->reading_time = ceil(($summary_word_count + $article_word_count) / $wpm_ave); // Populate back arguments (assuming they've been modified) $event->arguments(0, $page); }); As for your actual question... I haven't done this myself, but looking at the module and the field's settings, I believe you need to: Edit the settings of the "InputfieldTinyMCE" module. Look for the (image below) External Plugin files section, expand it if necessary, and it'll show you where to place your necessary file(s) for your additional plugins. Once your additional plugin(s) have been added properly to the InputfieldTinyMCE module's settings correctly, I do believe you'd then need to go to your TinyMCE field(s) that you want to take advantage of the plugin(s), and add/enable them. To do so, edit your field(s), go to the Input tab, and configure the necessary section(s) (I would assume the "External plugins to enable" would be the first to change) - my example image is blank only because I haven't added any plugins to my system. InputfieldTinyMCE module config: TinyMCE field Input tab setting: