Alex CA

  • Content count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About Alex CA

  • Rank
    Jr. Member
  1. I do have another task what I am trying to solve with the help of RSS module. Suppose my rss feed is based on a page which uses template A and it is pulling data from all templates on the website which has template B (which is say b_title and b_description). Now, I have another field in template B which has a filed type Page(lets called this field b_page) which essentially is for pages of another template (let's call it template C).This template C consists of a field called c_img. Now I want my rss feed template(A.php) to pull the title and description from template B and the image for the rss feed from template C. How do I achieve the retrieval of the image? I have tried representing my problem with a picture below. My current code looks similar to this: <?php // rss-feed.php template file // retrieve the RSS module $rss = $modules->get("MarkupRSSEnhanced"); // configure the feed. see the actual module file for more optional config options. $rss->title = "Latest updates"; $rss->description = "The most recent pages "; $items = $pages->find("tempalte=". $templateB .", sort=-modified,limit=20"); $rss->itemDescriptionField = 'b_Desc'; $rss->itemEnclosureField = 'b_page[0]->c_img'; // we take the first one since this field can consist an array of pages // send the output of the RSS feed, and you are done $rss->render($items); ?>
  2. @Macrura Thanks for all the help. The addHookProperty() did not work. Another simple solution (I should've tried it earlier ) is to directly use $rss->itemDescriptionField='e_desc|r_desc'
  3. @Macrura I did see how to instantiate the module. But how do I make module pick up r_desc and r_pic when it's generating the RSS feed when I select pages with template='Template1' and then make it pick e_desc and e_pic when the template is='Template2'. My condition for the page selector for my RSS feed is $pages->find("template=". $template1 ."|". $template2.", sort=-modified,limit=20");
  4. I was just using this module "MarkupRSSEnhanced" to generate my rss feed. My RSS feed specifically pulls data from 2 different templates. Though both these templates have the same title field called 'Title', their description field varies (one has r_desc and the other has e_desc) Is there a way where I can configure the model in such a way to pick up either of r_desc or e_desc (whichever is present on the template) I also have the same problem with adding the image to rss also since one has field name r_pic and the other has e_pic. PS-I cannot change the field names since I recently took over the project I am working on and it has been implemented by many others before me.
  5. In my search.php template, I am using $selector = "title|body%=$search_term, limit=50"; to find the top 50 search results for the page. I implemented this following this link My question is how does the selector sort its results? Does it look at the number of time the $search_term has occurred in the page or does it start searching from the root page to all the children. Also, will this change if I do not put any limits to the search results?
  6. I was able to make it work. There was a type in the previous code which caused the issue.
  7. I am currently designing a search page for my website. While I am able to get both pagination and fieldtype caching enabled separately, I am not able to implement them together. I followed the following 2 pages - Is there any way where I can combine these 2 methods for my website? Here is a snippet of my code $q = $sanitizer->text($input->get->q); $q = $sanitizer->selectorValue($q); // Search the cacged fields for our query text. // Limit the results to 50 pages. $selector = "search_cache~=$q, limit=50"; // If user has access to admin pages, lets exclude them from the search results. if($user->isLoggedin()) $selector .= ", has_parent!=2"; // Find pages that match the selector $matches = $pages->find($selector); //Get range of paginated results $start = $matches->getStart() + 1; $end = $matches->getStart() + count($matches); $total = $matches->getTotal(); $content = "<p><b>Showing search results ". $start . " - ". $end . " of ".$total."</b></p>"; // did we find any matches? if($matches->count) { $content .= '<ul>'; foreach($matches as $match){ $content .= '<li>'. $match->parent->title . ': <a href="' . $match->url . '">' . $match->title . '</a></li>'; } $content .= '</ul>'; $content .= $matches->renderPager(array( 'listMarkup' => "<ul class='pagination'>{out}</ul>", 'nextItemLabel' => "Next", 'previousItemLabel' => "Previous", )); } else { // we didn't find any $content = "<strong>Sorry, no results were found.</<strong>"; }
  8. Hi, I am just getting started with a project which has been previously built using Processwire2.7. I was wondering if there was anyway to modify the admin screen when entering data for a template. For example, I have created a student template with fields : Name, Major,Insitution, is Graduate?(checkbox) and a hidden field : ' Graduate level' Now, whenever I check the 'is Graduate? ' checkbox on the admin panel when entering the data, I want to show the 'Graduate level' field. Since, this is a change on the view for the admin page, I am not quit sure if there is some way to achieve this. Does anybody know how I could achieve this? Thanks!
  9. Alright I found the error. I had to install the module after adding it
  10. I was just looking at this module Profields It states that except Repeater Matrix ProField ,everything works with Processwire 2.6+. I am currently using Processwire 2.7.2 and I primarily wan to make use of Table and Autolinks. Has anyone using Processwire2.7 faced any issue with this module? I am relatively new to Processwire and I do not want to end up buying a module which could have compatibility issues. Thanks
  11. Thanks! I have currently implemented it using jQuery and use the API and was wondering if there was a module
  12. I am fairly new to Processwire and using APIs and I wanted to implement a certain functionality for one of my templates. Suppose I want all pages that use template A to display wiki content associated with page->title in page->body . For example if page->title is "Google", I want the body to consist of the data present on I understand that one way of doing this is using APIs from Wikipedia (but I do not have good experience in working with APIs) Could someone guide me though the process or point me to an already available module for this functionality in Processwire?
  13. Thanks a lot! This worked for me
  14. I am a newbie to Processwire and have been given a task to add some features to a website that has been already been developed. One of the fields (say Filed A), is of type Page. There are 100+pages in field A. A template Temp B uses this Field A and just displays the name of the pages of type Filed A selected for the page which uses the template B. Now, since there are many pages in Field A, it is displayed as a list and its gets difficult to scroll through the entire list in the admin page to find and add a particular entry from Field A. Could someone guide me if I could have a dynamic search bar for this field A which would work similar to how the search works on the processwire admin page? I want this search bar to be displayed right above the list of FieldA which will then dynamically improve the results as I type in the search box