-
Posts
2,765 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
you could assign a runtime parameter to them, see this topic for an example: https://processwire.com/talk/topic/10920-remove-duplicates-in-a-foreach-loop-but-count-them/?p=102592 notice how this assigns a count as a runtime parameter: $i->useCount = count($pages->find("interests=$i"));
-
nice work and you should submit it to the showcase
-
Image fields stop saving descriptions after a while
Macrura replied to OviS's topic in General Support
@OviS, IMHO it wouldn't make sense to migrate a site off of processwire prior to doing a simple alternate server test, b/c once you know it's the server and not PW, won't you regret that decision? -
you could use a class on the anchor, and then have your modal target that
-
Image fields stop saving descriptions after a while
Macrura replied to OviS's topic in General Support
@OviS, i'm also sorry to hear about the troubles you are experiencing. I can only comment on the steps I would take if I was in your situation, and that is I would copy the whole site to a different server and see if the problem still happens. In your description of the problem, you said this was happening to many sites on one server, and if we assume that your situation must be unique, as no one else has reported anything similar, then the server would be my prime suspect. In addition, Arjen reports the same issue was solved by migrating servers. -
i think 3.0 is a namespaced version, so be careful, it comes with some caveats for usage. Keep an eye out for info on this.
-
yeah, this is totally fine with me (didn't think of doing it this way.)... leave the module!
-
thx - right, but in my case i needed the class on the UL; i could fiddle with the CSS and see about adding those classes one level up as a wrapper like you have..
-
hey Soma, thanks for this, it's working really well for a project i'm doing right now! I ended up needing to add some classes to the outer wrapper...(the buttons are in a share button which opens a menu).. i was wondering if you might consider adding a config option at some point for outer wrapper class, if you think that may be of use to others.
-
yep, you may want to start off not using _main.php. in my processwire web dev class, i have the beginners do simple head.inc and foot.inc includes.
-
Deleting file field's files via API not working or timing out
Macrura replied to hellomoto's topic in General Support
how about try this before you remove: $page->of(false); // to this before the removeAll(); $page->tracks_upload->removeAll(); $page->save(); -
Developer centric form processor
Macrura replied to Mike Rockett's topic in Module/Plugin Development
YAML support would be cool! -
cool - thanks! loving to hear more suggestions and enhancements. This simple recipe is going to make things at least 50% easier for my clients, especially those who seldom access their sites and then when they do they can't remember where anything is... arriving at the page tree for about 70% of my sites is a non-sequitur; For example on New Focus Recordings, we use almost exclusively listers, so better to login and land on a quicklink list so you can get where you need and maybe not even see the (wonderful) page tree at all.
-
Sometimes you have clients who will login to the admin, and they perhaps only need to access a few areas of the site, such as: a product or blog list (ListerPro) site settings formbuilder entries specific front end pages documentation helpdesk backup interface Server health or server status (for example site5 has a page for every server to see it's status) Link to a bookmark (page tree bookmark for example) - this is awesome by the way Run a special action like clear a wirecache or other custom caching Add a billing or late payment notice Add an alert about upcoming server maintenance The Problem: How can you collate all of these diverse links and messages into 1 page, as fast and easy as possible, make it hassle-free to add stuff to it, maybe some messages, change the order of the links etc. In some systems this is called the Dashboard. You can make one in a few minutes using: 1.) Admin Custom Pages 2.) ready.php in your site folder Steps: Install ACP create a file inside templates for your dashboard (e.g. _ac_dashboard.php). Create your dashboard page below the admin branch of the page tree, assign it to ACP, and set the template to use to the one you created. This example will display a table of quicklinks. Contents of the dasboard file: <?php wire('modules')->get('MarkupAdminDataTable'); ?> <h3>Title of site here</h3> <div id='ProcessFieldList'> <table id='AdminDataTable1' class='AdminDataTable AdminDataList AdminDataTableResponsive AdminDataTableSortable'> <thead> <tr> <th>Item</th> <th>Comment</th> </tr> </thead> <tbody> <tr> <td><a href='<?php echo $config->urls->admin?>blog/'>Blog</a></td> <td>Filterable/Searchable listing of blog posts.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>news/'>News</a></td> <td>Filterable/Searchable listing of news items.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>projects/'>Projects</a></td> <td>Filterable/Searchable listing of projects.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>page/'>Page Tree</a></td> <td>A hierarchical listing of the pages in your site.</td> </tr> <tr> <td><a href='<?php echo $config->urls->admin?>settings/'>Site Settings</a></td> <td>Global site settings</td> </tr> </tbody> </table> <script>AdminDataTable.initTable($('#AdminDataTable1'));</script> </div><!--/#ProcessFieldList--> You only need this if you want to redirect logins to the dashboard: add to ready.php (where 1234 is the ID of your dashboard page): if($page->template=="admin" && $page->id == 2) $session->redirect($pages->get(1234)->url);
-
yes, good point... would be keen to see it. Mostly though, i never seem to be able to use stock systems, because the business logic is hard to encapsulate into one system, which is why if you build this with PW backend, then you are really tailoring it for specific use; I also say this because i just alighted from a 200+ hr asp.net project (where my part was only a fraction of the total labor) in building a custom app, and never a day went by when i observed how so many of the things we needed to constantly build and rebuild and fix could have been handled simply by pw admin;
-
@FrancisChung, perhaps I'm misunderstanding this, but I think you are saying they are pasting markup into an RTE? That could never work under any circumstances, because RTE means rich text, not markup. If they want to paste in markup, they would have to first click the code view button.
- 10 replies
-
- 1
-
- HTML Entity
- HTML
-
(and 2 more)
Tagged with:
-
Module Module: RuntimeMarkup Fieldtype & Inputfield
Macrura replied to kongondo's topic in Modules/Plugins
In my case i only have 1 field and then my code checks for which template it's on, then outputs various buttons and messages; the buttons themselves just link to templates that read the url parameters and run some process. Eventually i'll probably have a generic module to process the buttons.. i think I'm going to be using this a lot! -
Module Module: RuntimeMarkup Fieldtype & Inputfield
Macrura replied to kongondo's topic in Modules/Plugins
This is such a great module; recently I used it to create custom action buttons on my calendar/futuremail app; Send or preview the email message for the future mail: send or preview a calendar event, which is typed by a chosen template (e.g. event, lesson reminder, etc.) -
beginnerquestion on performance with a textformatter
Macrura replied to mr-fan's topic in Module/Plugin Development
thanks, nice idea and good example. sometimes i have a replacements table or textarea right in the editor; then i use {{tokens}} in the body to grab those values; (template does the runtime replacement). Sometimes you might have some boilerplate content that is reused in various places but needs to have certain terms replaced contextually to the page.. +---------+----------+ | search1 | replace1 | +---------+----------+ | search2 | replace2 | +---------+----------+- 5 replies
-
- textformatter
- beginner
-
(and 1 more)
Tagged with:
-
No, it doesn't really work that way, but at the same time you are stating the obvious, and it won't ever be necessary to appeal to people who want plugins. @cssabc123, can you provide some examples of sites you have developed? For example some successful sites that run Wordpress with a lot of plugins? I have such sites, and it's no fun at all. Yesterday a WP ecommerce site broke on iOS9; 3 hrs to upgrade the template to fix it. When i login to this site there are alerts all over the admin about licenses that need to be renewed, plugin updates, and stuff like that. We can barely keep track of the plugin subscriptions needed to make this site work.
-
the only snafu i encounter with delayed output is that i lose the syntax highlighting of the HTML when it's all inside quotes as well as no double cursor (in ST for example)... though i do use it a lot when constructing repeating elements like table rows, lists, galleries.. also with delayed output you can store the markup into the wire cache.
-
maybe you don't need to used delayed output? it can make many things more trouble than it's worth. Have you tried the simple include head/foot method.
-
it's just a lot better.
-
ckeditor - Remove wrapping <p> from <img> in source code
Macrura replied to CodeCoffeeCode's topic in Modules/Plugins
you could do a string replace on <p><img to <img and /></p> to /> when outputting. or turn off auto paragraph but that probably would be bad config.autoParagraph = false; -
if you were going to use them on a particular template with url segments, that would be pretty easy to setup. the template itself would parse the hashid and deliver the page content. there would be some options for generating the hashed URL, it depends on how you are using it; you could use Kongondo's new module and create a link on the page editor to the hashedID URL of the page. or you could replace all of the page urls for a particular template something like this (untested): wire()->addHookBefore('Page::path', function($event) { include('./classes/hashids.php'); $hashids = new hashids('your_unique_salt'); $page = $event->object; if($page->template == 'some-template') { $event->replace = true; $hashedID = $hashids->encrypt($page->id); $event->return = "/$hashedID/"; } }); on the template you would need to decrypt the id and render the content