Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using i18 Special Pages in connection with i18n Search
#1
I have a special page which has two fields: "first" and "second". It also has a tag "_special_myspecial".
I used a search function to find all myspecial pages and can't figure out how to get the special fields.

Code:
<?php
$results = return_i18n_search_results(array('_special_myspecial'));
foreach ($results['results'] as $entry) {
   $first = $entry->data['first'];
   $second = $entry->data['second'];
?>

This is not working, i.e. $first and $second are empty.

There is also function return_special_field($name, $default='') but I don't know how to call it in the context of each search result row above.
Reply
#2
My php skills are not enough to be able to tell where your issue is with your code. But another way to acheive the same effect is with component . Add a new component that include the fields that you want to display. Each of the matches from the search will use the component rendering to display the results.

Angryboy makes extensive use of components in his tutorials
Reply




Users browsing this thread: 1 Guest(s)