rlwsota
Members-
Posts
28 -
Joined
-
Last visited
Recent Profile Visitors
1,011 profile views
rlwsota's Achievements
-
HermodBB - Basic BB/Forum/Comments module
rlwsota replied to GuruMeditation's topic in Module/Plugin Development
Understood. I applaud your efforts (and those of all who create modules for PW) for the diligence required. Perhaps as my neophyte-ness fades, I'll be able to contribute something of value. As for your question, I'm always keen on options but agree that there is little need to reinvent the wheel. If a current solution doesn't fit the need, that's a good reason to revisit the matter but for most uses that's probably not the case. PW is great for lots of reasons, including its inherent flexibility. -
HermodBB - Basic BB/Forum/Comments module
rlwsota replied to GuruMeditation's topic in Module/Plugin Development
GuruMeditation, Thanks for the reply and update on your LiteBB efforts. Sounds promising and I like the ability to tie your Lumberjack logger in easily. I will heed your recommendation on HermodBB and not work with it any longer. Do you have ETA for LiteBB to make its debut? -
HermodBB - Basic BB/Forum/Comments module
rlwsota replied to GuruMeditation's topic in Module/Plugin Development
GuruMeditation, I just came across your HermodBB and it looks great. Installation went as expected. I'm struggling with getting it in place but I'm a neophyte and still learning, so I expect those are issues on my side. Curious about your most recent comment on releasing as LiteBB. Where does that stand? Edit: bad typing corrected. -
Sure enough, after posting I found this: https://processwire.com/talk/topic/10562-general-question-is-there-a-difference-between-adding-prependappend-file-to-template-and-include/. Using the 'include' in the template php file solved the issues. Now I'll just crawl back into my newbie hole.
- 1 reply
-
- 3
-
I have a template file that I would like appear differently under different conditions (call them ’standard’ and ’special’). As part of the layout matters, I want to change the Append File (Templates -> Edit Template: XXXX -> Files -> Append File) just for the special case (i.e., not permanently). I have no Append File in the _init.php because I use several layouts throughout the site and use Append File for each template. For example, the standard case will have Append File as _pageLayout1.php, but for those special cases I want to change the Append File to _pageLayout2.php. I’ve looked through the Forums and API documentation but haven’t been able to find a way to do it. Of course I’ve probably missed previous queries on the topic or it is blindingly simple, but I’m stuck. Any suggestions?
-
Page added to page field does not appear to be saved
rlwsota replied to rlwsota's topic in API & Templates
Adrian, Perfect! You are a Champ! Many thanks. -
Page added to page field does not appear to be saved
rlwsota replied to rlwsota's topic in API & Templates
Adrian Sorry if I didn't make it clear. As a user is reading an article (page), they are able to hit a button to add that page to their favs list. Right now, I have a button that takes it to a page to confirm the transfer of information as shown above and make the array addition but I once it is working I will simply refer it to a .php file to handle the addition to the page field. Does that answer your question? -
Page added to page field does not appear to be saved
rlwsota replied to rlwsota's topic in API & Templates
Adrian, Thanks for the suggestion. I did have TracyDebugger installed (but do now). When I added the $p->of(false); code before adding the page, I got an error as follows: Server ErrorWe're sorry! The server encountered an internal error and was unable to complete your request. Please try again later. error 500 The error log shows the following with the code installed: Error: Exception: Method PageArray::of does not exist or is not callable in this context (in /home/my_website/public_html/wire/core/Wire.php line 358) #0 /home/my_website/public_html/wire/core/WireArray.php(1686): Wire->___callUnknown('of', Array) #1 [internal function]: WireArray->___callUnknown('of', Array) #2 /home/my_website/public_html/wire/core/Wire.php(398): call_user_func_array(Array, Array) #3 /home/my_website/public_html/wire/core/Wire.php(333): Wire->runHooks('callUnknown', Array) #4 /home/my_website/public_html/wire/core/Wire.php(337): Wire->__call('callUnknown', Array) #5 /home/my_website/public_html/wire/core/Wire.php(337): PageArray->callUnknown('of', Array) #6 /home/my_website/public_html/site/templates/follow.php(18): Wire->__call('of', Array) #7 /home/my_website/public_html/site/templates/follow.php(18): PageArray->of(false) #8 /home/my_website/public_html/wire/core/TemplateFile.php(182): require('/home/my_website/...') #9 [internal function]: TemplateFile->___render() #10 /home/my_website/public_html/wire/core/Wire.ph When I // the line, the page runs with the right echos but still no saving to the page field. -
Page added to page field does not appear to be saved
rlwsota replied to rlwsota's topic in API & Templates
cstevensjr, I edited my original post to show the code that I am using for the page array addition. The only other items on the page are some echo statements to confirm that, in fact, the page referral is correct (it is), that the original page field shows the current contents (it does) and a 'foreach(...' to step through each of the page field contents. It is as follows: $page_id = $_GET[‘source_page’]; echo $page_id; // confirmed $p = $user->favs; //existing page field echo $user->name; // confirmed echo $p; // confirmed $p->add($page_id); $p->save(); $FP = $user->favs; foreach($FP as $fave) { $content .= "<p>$fave $fave->title</p>"; } When the ‘foreach…’ routine runs, it does show the newly added $page_id, but that is not saved to the page itself. Thanks for your consideration. -
Page added to page field does not appear to be saved
rlwsota replied to rlwsota's topic in API & Templates
cstevensjr, Ah, clarity. Often useful, sometimes not provided. My bad. I have a Profile page that Ryan put forth in the Form Builder forum (https://processwire.com/talk/topic/9574-edit-user-profile-frontend/?hl=profile) that shows fields in a user's profile. In my case, I have added to the Profile to show the favs pages. The ones that already are in the array appear (checked) but the new one I am trying to add do not appear. Does that answer your question? -
I have what I gather is some sort of incompatibility and ask for any advice that may be available. I have a field (‘favs’) in the user template. This is a page field currently set for multiple pages (page array) with checkboxes and calls pages from a specific parent (articles). A user profile is based on Ryan’s Form Builder profile and those items that are checked load when calling the field. In another template, I have an ‘add' button that leads to a php file (currently shown on a page to troubleshoot) that includes ‘$user->favs->add($new_page)’ (also tried push and append, but results the same) that is intended to add the page that hosts the button to the favs field. The new php file/page does echo the $new_page ID and on that page, as a test I do run a “foreach…” routine to list the pages in the field, the new one appears to be added to the other pages in the field. Unfortunately, when I look at the user information from the admin side, the new page does not appear to have been added and when I pull up the Profile again, it is not added. On a suspicion that the checkboxes is the issue, I tried changing it to select/selectmultiple/asmselect but there is no change. I also tried various versions of adding the new page with a value = 1 (got an error). All I want to do is deal with ‘favs’ as an array of page ids that I can reference accourdingly. I’m sure I must be missing something quite obvious, but I can’t figure out how to add a new page to the page field and have it actually appear. Help appreciated. To add some clarity, this is the bit of code with which I am trying to add the new page: $page_id = $_GET[‘source_page’]; //referring page, shows up properly with echo $p = $user->favs; //existing page field contents, shows up correctly with echo $p->add($page_id); $p->save(); Thanks.