Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N Special Pages
Cerulean Wrote:Does every special page have to have a parent?
The interface says:
Quote:If you leave the parent page empty, it must be selected when creating a page

So does this mean you can't have a special page as a top level page? For instance, can you have the website home page be a special page?

if i needed to do that, i would make a component to render the search results of an i18n search, and filter it to just the page needed using a special tag; like if you were to add a tag '_homepage' to the tags of that particular special page, and then in your search string on the page that is the index/homepage you would put this:

(% searchresults tags:_homepage component=homepage HEADER: %)

the component 'homepage' would look something like this
Code:
<h1><?php echo htmlspecialchars($item->title, ENT_NOQUOTES); ?></a></h1>
<?php echo $item->getExcerpt($item->content, 300); ?>

and you would use this same format to access your other fields in the special page:

Code:
<?php echo htmlspecialchars($item->fieldname, ENT_NOQUOTES); ?>

-marc
Reply
Cerulean Wrote:Does every special page have to have a parent?

No.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Ok....so I may be getting in way over my head, but I am going to ask anyway.

I am setting up a movie blogging site for a client and I want to use the api setup by http://www.themoviedb.org and combine its data with the special pages plugin. Here is my thought:

Whenever a new post is created one of the fields in the special pages plugin is for the movie id from TMDB. Whenever the page is saved I want to have get-simple download specific data from TMDB (poster, synopsis, cast...) using the movie ID and save it in the special page XML file.

Their api seems pretty straightforward. I can manage to download data from their and save it on my site. But where would I put the logic in the special pages plugin to do this? I would think it would be when the page is saved or edited and it would be saved as another special field. Any ideas on this?


Thanks
Reply
Re: i18n Special Pages - feature requests/comments

special pages has proven to be incredibly flexible and useful for developing sites, and I have found many uses for it beyond what it might have originally been intended for, such as managing sidebar widgets, blog listings of pages, slideshow markup, carousels, image galleries and product listings;

having used/tested/experimented with it for a while, i have come up with some ideas for possible features that could make it better;

One thing would be the option to have the multi-line text field appear as a code editor, so that if you need to have one of your custom fields contain some html/php code, it will be easy to edit if necessary...

Another thing that might be useful would be the ability to turn off the default content field, so if you have a special page type that is using only fields, but not the content editor, that could be hidden (would save time loading the backend page editor...)

[edit: i removed the request for raw output, since it looks like n00dles Matrix plugin will solve the issue of custom output...]

-marc
Reply
Please ignore my previous post. I have thought more about it and looked into it, I think it would be better as a seperate plugin. This is way beyond my ability, but I found a wp plugin that I am going to try and hack it to a series of functions. Maybe someone with more skills can turn it into a plugin for GS after that.
Reply
I'm having issues with the special pages image browser;
the pop up browser comes up blank; could it be a conflict with another plugin, or some setting?

Edit: Solved - the 'General Settings' > 'Website URL' was different than the logged in URL (no www in the URL..)
Reply
I need help with custom rendering for a special page. Below is the code for my component named "latest-review"

Code:
<div>
<hr />
<h3 class="search-entry-title">
  <a href="<?php echo $item->link; ?>">
    <?php echo $item->review-title; ?> - <?php echo $item->title; ?>
  </a>
</h3>
<div class="search-entry-date">
  Posted: <?php echo strftime('%A - %B %d, %Y', $item->creDate); ?>
</div>
<div ><?php echo $item->content; ?></div>
<hr />

The special field "review-title" shows up on the page as a "0". The review-title field displays correctly when searched in the default search.

A second issue that I am having with the custom rendering is the spoiler plugin not working.

Here is a link to the page using the custom rendering:
http://thatmovieguy.com/tester
Reply
jay_m Wrote:The special field "review-title" shows up on the page as a "0". The review-title field displays correctly when searched in the default search.

I assume this is a component for I18N Search custom rendering?
Your custom/special properties should only be named with A-Za-z_, as $item->review-title is interpreted as $item->review - title, both of which are undefined and thus 0, when converted to a number.

If you use the custom rendering of special pages (the view and search tabs in the special pages settings), you should use the function get_special_field('propertyname') and in that case a - will work, too.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Yes you assume correctly.

mvlcek Wrote:I assume this is a component for I18N Search custom rendering?
Your custom/special properties should only be named with A-Za-z_, as $item->review-title is interpreted as $item->review - title, both of which are undefined and thus 0, when converted to a number.

Did you mean to include the "_" (underscore) as list of acceptable characters. I get an error when I use one, "The field names must be alphanumeric".
Reply
jay_m Wrote:Yes you assume correctly.

mvlcek Wrote:I assume this is a component for I18N Search custom rendering?
Your custom/special properties should only be named with A-Za-z_, as $item->review-title is interpreted as $item->review - title, both of which are undefined and thus 0, when converted to a number.

Did you mean to include the "_" (underscore) as list of acceptable characters. I get an error when I use one, "The field names must be alphanumeric".

It should be a valid PHP variable name (without the $) and it seems I included some more validation in the plugin, so you are on the safe side, if the first character is A-Za-z and the following are alphanumeric.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
i'm getting this problem when i use the wysiwyg insert link for custom field...any idea what causes this?
Reply
Repeat Question...
So I know I've asked this before and the answer was "No" but it was a while ago so I will see if anyone has come up with a solution...

I have my portfolio site built with Special Pages, but I desperately need a Previous and Next item page button on each page. I really don't want to have to rebuild from scratch with another plugin that has this feature, so...

Is there any way via Special Pages or I18N Navigation to add previous and next buttons to each page? Does anyone know of any code snippets of functions i could add to the special pages View section to solve this problem?

Any help would be much appreciated.
Reply
@Dominic - the main issue is that in the xml data structure there is no concept of 'next' and 'previous' like there would be in a database/record structure; you would somehow need to load all of the slugs for that special pages type into an indexed array and then you would be able to reference the slugs by their index #; I'm not a php guru, but i know it can be done; the way i did this was to put a number suffix on my slugs for the portfolio and then i used some php to call the next/previous that way;

a new component that is in beta now, called 'the matrix' has a built in function for next and previous records;
Reply
alienee2 Wrote:@Dominic - the main issue is that in the xml data structure there is no concept of 'next' and 'previous' like there would be in a database/record structure; you would somehow need to load all of the slugs for that special pages type into an indexed array and then you would be able to reference the slugs by their index #; I'm not a php guru, but i know it can be done; the way i did this was to put a number suffix on my slugs for the portfolio and then i used some php to call the next/previous that way;

That explains it very simply. Thank you.
Reply
Dominic Wrote:I have my portfolio site built with Special Pages, but I desperately need a Previous and Next item page button on each page. I really don't want to have to rebuild from scratch with another plugin that has this feature, so...

Is there any way via Special Pages or I18N Navigation to add previous and next buttons to each page? Does anyone know of any code snippets of functions i could add to the special pages View section to solve this problem?

If you mean a navigation to the previous and next sibling page (page with the same parent), you can use I18N Navigation and a component as shown here.

You could also create previous and next links by doing a search using return_i18n_search_results with the special page tag _special_type (change type to your type) (or any other tag) and then searching for the current page URL and displaying links to the previous and next search result similar to above.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:If you mean a navigation to the previous and next sibling page (page with the same parent), you can use I18N Navigation and a component as shown here.

You could also create previous and next links by doing a search using return_i18n_search_results with the special page tag _special_type (change type to your type) (or any other tag) and then searching for the current page URL and displaying links to the previous and next search result similar to above.

This is a perfect solution! Actually even better than a previous and next button! So simple to implement too! Thank you!
Reply
What's the best way to change the page's date? I know it's saved in creDate but is it safe to add as an editable field?
Modern UI Admin for GetSimple
Watch the demo. Install this plugin. Use this CSS. Enjoy.
Reply
sal Wrote:What's the best way to change the page's date? I know it's saved in creDate but is it safe to add as an editable field?
To my knowledge you aren't able to create a creDate or pubDate custom field. I usually just edit it directly in the .xml file within my web provider's file manager. Open the file and edit what is between the <creDate> and </creDate> tags, ensuring your new date is in the same format. Then open and resave your page in the admin panel of GetSimple and your creation date should be fixed (that final step is to fix any caching errors that might otherwise crop up).
Reply
Bug report, but I don't think this is specific to I18N Special Pages (see this earlier report on loss of WYSIWYG content).

If there is an error when saving the configuration for a Special Page ('Edit Special Page Type'), then any default page content is lost, even if it has previously been saved successfully.

It is possible to revert to the previously saved settings (If existing) by clicking 'Cancel' at the bottom of the page, but the normal reaction is to simply correct the cause of the error and 'Save' again, at which point the default content is lost.
--
Nick.
Reply
With a custom field of type "date" this could make a pretty kick-ass events calendar.
Modern UI Admin for GetSimple
Watch the demo. Install this plugin. Use this CSS. Enjoy.
Reply
sal Wrote:What's the best way to change the page's date?

I think a solution would be a plugin that lets you edit the creDate field.
I started making one (similar to pubdatefix) a couple months ago, but it's half made. I'll probably finish in summer...
Reply
sal Wrote:With a custom field of type "date" this could make a pretty kick-ass events calendar.
As well as a possibility for embargo and expiry dates.
--
Nick.
Reply
Does anyone know of any reason (or ever experienced) why you can't put the tags straight into the template...? I have tried many variations but just can't get it to work... I know you can enter the HTML/PHP in the 'View' box when you are setting up the special pages, but the reason I would like them in the template is because they are quite spread around the page, and would much prefer them defined in the template assigned to that special page...

I may be missing something quite obvious, but if anyone could help, it would be much appreciated... (excuse all my dots... bad habit!)
Reply
QuestarDean Wrote:Does anyone know of any reason (or ever experienced) why you can't put the tags straight into the template...?

<?php get_special_field('myfieldname', 'adefaultvalue'); ?> works just fine in the template: it will show the field's value on pages that have this special field and the default value on other pages.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I've tried that loads of times. Just doesn't seem to want to do it, I just have a blank space in the place it should be...

Something odd I have noticed is when I set all special pages to use the page template 'members.php' by default (in 'configure special pages' > 'general' tab) and leave the 'view' fields blank (so the tags are in the template), nothing comes in, even if I put something static like 'TEST' on the template above or below the code. It's as if it goes to the default template automatically...
Reply




Users browsing this thread: 16 Guest(s)