Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N Special Pages
#26
Been making a lot of progress with this, and the possibilities seem endless...!

here are a couple of things i got stuck on:

1.) when in the configure screen for special pages, when i click the 'view' button, the "HTML/PHP code for the header of the page" box looks empty until i click into it, and then it shows the contents of that.

2.) I can't seem to get rid of the language suffix on the links from the search results, they all have this on the end: /?lang=en
but i have i18nsearch set to not display language... and i have the search result tag set as showLanguage:0

my search results template is using this for the link to the special page:
Code:
<?php get_special_field('link','',false); ?>">

3.) Would it be possible to be able to add tags to the page header on the search results, in addition to the special page view? This would be used for example if there was custom css needed to display the search results in a certain formatting that requires css, without having to add that to the template file (to make the special page type more portable between templates...)

4.) seems like the ability to sort by a custom field is working and this is really great; is there any syntax to order items in reverse of a custom field, for example if i have a field containing years, and want to display the most recent year at the top of the list....

thanks again!

-marc
Reply
#27
alienee2 Wrote:Been making a lot of progress with this, and the possibilities seem endless...!

here are a couple of things i got stuck on:

1.) when in the configure screen for special pages, when i click the 'view' button, the "HTML/PHP code for the header of the page" box looks empty until i click into it, and then it shows the contents of that.

That happens, if you have the Theme Highlighter plugin installed. I couldn't find a solution so far.

alienee2 Wrote:2.) I can't seem to get rid of the language suffix on the links from the search results, they all have this on the end: /?lang=en
but i have i18nsearch set to not display language... and i have the search result tag set as showLanguage:0
my search results template is using this for the link to the special page:
Code:
<?php get_special_field('link','',false); ?>">

The language is always added to the link, if you have the I18N plugin installed (to make sure the linked page's language is the same as that of the search result). But if you have only one language you can use the field simplelink instead of link.

alienee2 Wrote:3.) Would it be possible to be able to add tags to the page header on the search results, in addition to the special page view? This would be used for example if there was custom css needed to display the search results in a certain formatting that requires css, without having to add that to the template file (to make the special page type more portable between templates...)

This is not easily possible, as I don't know in the header, if search results are displayed - there could be a (% searchresults %) tag in the content, the content could call a component, there could be a list of search results in the template - and additionally I don't know which search results will be displayed, which would mean that all styles of all special pages would need to be included.
So you have to add the styles to the global CSS file or define them inline.

alienee2 Wrote:4.) seems like the ability to sort by a custom field is working and this is really great; is there any syntax to order items in reverse of a custom field, for example if i have a field containing years, and want to display the most recent year at the top of the list....

Sorting by a custom field? What are you talking about?
The only custom field to sort by is the creation date!?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#28
mvlcek Wrote:
alienee2 Wrote:4.) seems like the ability to sort by a custom field is working and this is really great; is there any syntax to order items in reverse of a custom field, for example if i have a field containing years, and want to display the most recent year at the top of the list....

Sorting by a custom field? What are you talking about?
The only custom field to sort by is the creation date!?
I don't think he meant sorting in that way. I believe it was the indexing function that you fixed (so only showing (rather than ordering) results pertaining to a search from a particular custom field).

Also your update did indeed fix the issues (at least the ones I saw) regarding the field display (particularly the drop-box option and having a WYSIWYG editor next to a standard text field which would squash it).
Reply
#29
-using simplelink is a good thing to know...solves that..

-not a problem with the CSS on the results page...

mvlcek Wrote:Sorting by a custom field? What are you talking about?
The only custom field to sort by is the creation date!?

ok sorry for my ignorance..., i guess i'll have to figure out a hack to get the results to display in a custom order..maybe put the year in the slug and sort by reverseurl..

would be cool though if you could sort on any custom/special field, ascending or descending...

-marc
Reply
#30
alienee2 Wrote:ok sorry for my ignorance..., i guess i'll have to figure out a hack to get the results to display in a custom order..maybe put the year in the slug and sort by reverseurl..

would be cool though if you could sort on any custom/special field, ascending or descending...

Nothing to be sorry for. You wrote that "to sort by a custom field is working" and I was wondering what you meant, as I didn't implement it.
I'll put it on the wish list for the next release.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#31
Having a little trouble figuring out how to use this as an items manager.
I have set a thumbnail in each of the special products pages special fields areas. But I want to get the thumbnails to display on the parent page and link to their individual special pages.
Is this possible? It seems like it should be but I can't figure it out.
Reply
#32
Dominic Wrote:Having a little trouble figuring out how to use this as an items manager.
I have set a thumbnail in each of the special products pages special fields areas. But I want to get the thumbnails to display on the parent page and link to their individual special pages.
Is this possible? It seems like it should be but I can't figure it out.
@Dominic: Have you configured your 'Items' special page using the 'SEARCH' tab on the 'Configure Special Pages' plugin page? Go to it, then copy and paste the the default php code that mvlcek provides on that page into the text field, then wherever you want to in that same coding, paste this (which assumes that your thumbnail field is called 'thumbnail'):

Code:
<a href="<?php get_special_field('link','',false); ?>">
    <?php if (return_special_field('thumbnail')=='') echo " "; else echo "<img src="; get_special_field('thumbnail'); ?>
    <?php if (return_special_field('thumbnail')=='') echo " "; else echo ">"; ?>
</a>
Then save it. On your parent page, have this somewhere (which assumes that your special page is called 'items':

Code:
(% searchresults addtags=_special_items tags=_special_items %)
Then save. Someone else may be able to clean that up slightly, but that piece should now output the link to the child page(s) with the thumbnail displayed inside of it. If there is no image link provided, it outputs nothing, so you won't have the problem of it displaying broken images if you have no link in the field. Hope this works!

@mvlcek: When using the 'image' field, the button says "{i18n_customfields/BROWSE_IMAGES}". I assume that it was meant to show something else?
Reply
#33
@AngryBoy
Awesome! This was a big help and exactly what i needed to get started. I've been beating my head against the wall for a month trying to figure out how to do this!!!
Thank you!
Reply
#34
Angryboy Wrote:@mvlcek: When using the 'image' field, the button says "{i18n_customfields/BROWSE_IMAGES}". I assume that it was meant to show something else?

Corrected in I18N Special Pages version 0.7.5.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#35
Angryboy Wrote:@Dominic: Have you configured your 'Items' special page using the 'SEARCH' tab on the 'Configure Special Pages' plugin page? Go to it, then copy and paste the the default php code that mvlcek provides on that page into the text field, then wherever you want to in that same coding, paste this (which assumes that your thumbnail field is called 'thumbnail'):

Thanks for the answer, Angryboy!
The cleaned up code (curly braces around branch, quotes for src parameter, encoding of thumbnail - 3rd parameter false, alternative text "Show" if no thumbnail):
Code:
<a href="<?php get_special_field('link','',false); ?>">
    <?php if (return_special_field('thumbnail')!='') { echo '<img src="'; get_special_field('thumbnail','',false); echo '">'; } else echo "Show"; ?>
</a>

Angryboy Wrote:Then save it. On your parent page, have this somewhere (which assumes that your special page is called 'items':

The parameter tags is sufficient (although having both does not matter):
Code:
(% searchresults tags=_special_items %)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#36
Dominic Wrote:@AngryBoy
Awesome! This was a big help and exactly what i needed to get started. I've been beating my head against the wall for a month trying to figure out how to do this!!!
Thank you!
You're welcome. Glad to have helped :-)
mvlcek Wrote:
Angryboy Wrote:@mvlcek: When using the 'image' field, the button says "{i18n_customfields/BROWSE_IMAGES}". I assume that it was meant to show something else?

Corrected in I18N Special Pages version 0.7.5.
Thanks for fixing that and thanks for shortening the code so neatly :-) I'm not PHP literate, so I didn't know construct echo statements that succinctly. Thanks again!
Reply
#37
Can you convert a normal page into a special page ?
I want to move all my custom fields stuff over to this.

I noticed when you save the views, it goes back to general, can that be made to stay put ?
Or add a blind save ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#38
I can't select an image using the image field; i'm getting 404 on the front end;this is using the 3.1 stable;
this was working on the beta...

here is the URL it is trying to load:

http://...com/plugins/i18n_specialpages/browser/filebrowser.php?func=fill_4&type=images

thanks for any help!

-marc
Reply
#39
alienee2 Wrote:I can't select an image using the image field; i'm getting 404 on the front end;this is using the 3.1 stable;
this was working on the beta...

here is the URL it is trying to load:

http://...com/plugins/i18n_specialpages/browser/filebrowser.php?func=fill_4&type=images

thanks for any help!

-marc

hmm im still on sp .7.4
and mine is
plugins/i18n_customfields/browser/filebrowser.php?func=fill_1&type=images
and it works fine.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#40
shawn_a Wrote:
alienee2 Wrote:I can't select an image using the image field; i'm getting 404 on the front end;this is using the 3.1 stable;
this was working on the beta...

here is the URL it is trying to load:

http://...com/plugins/i18n_specialpages/browser/filebrowser.php?func=fill_4&type=images

hmm im still on sp .7.4
and mine is
plugins/i18n_customfields/browser/filebrowser.php?func=fill_1&type=images
and it works fine.

Oops, I forgot to rename some paths when copying I18N Custom Fields functionality.
I hope, it's now fixed with I18N Special Pages version 0.7.6.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#41
ok great - works now...!

-marc
Reply
#42
great extension ! thank you.

But I miss some Features:

I don't like the idea to show the fields in the "page options".
There is a extension with a much better solution for showing the fields: http://get-simple.info/extend/plugin/items-manager/301/

I miss a better files / images field with some more options:

- Multi Files selection
- Multi Files Upload
- Set Files Folder
- Show as Link
- Show as Image / Gallery

Than I miss:
- options Field (radio buttons)
- HTML Field to showing some text for consumer
- Mark field as required
- Tags and Character Counter for text fields
Reply
#43
Spanish language for I18N Special Pages available in Extend
Reply
#44
@mvlcek

The admin page for "Special Pages of type XXX" is broken if you don't have the I18N (base) plugin.

I get this at the end of the (source code of the) page:
Code:
<b>Fatal error</b>:  Call to undefined function find_i18n_url() in <b>C:\xampp\htdocs\gs31\plugins\i18n_specialpages\pages.php</b> on line <b>154</b><br />
Reply
#45
I18N Special Pages version 0.8:
  • includes spanish (thanks @Carlos)
  • solves a problem with saving pages, if a special field is called id
  • shows correct view links on the special pages list, if I18N is not installed
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#46
I asked this before..

Can you convert a normal page into a special page ?

I tried adding the special tag to them but that didn't work.
Got any suggestions on how to move all my custom fields pages over to this plugin ?
I don't care about the fields just the contents.

Even a dirty manual way to do it.

EDIT:
It appears you can add the xml to the page file for the app category.
<special>specialpagetype</special>

It would a real neat feature, if we could do an import or just add the tag to the page and do some kind of detect new function.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#47
shawn_a Wrote:I asked this before..

Can you convert a normal page into a special page ?

...

It appears you can add the xml to the page file for the app category.
<special>specialpagetype</special>

It would a real neat feature, if we could do an import or just add the tag to the page and do some kind of detect new function.

Yes, I agree, but there are some problems:
  • what should happen, if the special page type configures a parent? change it?
  • what should a configured slug do? change the slug of the page according to the current date?
  • what about a configured menu position?
  • where is the best place to put this functionality in the admin GUI?
The first three points are real issues because these fields (if configured) aren't visible to the user and thus can not be changed afterwards.

Changing the template, adding tags and setting the new special fields to the default values should be no problem.

Any suggestions welcome!
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#48
1 issue and some questions...

ISSUE:
- can't insert an image into a WYSIWYG special field.

QUESTIONS:

1.)
How would i show the tags for a special page, say for example in the meta of a blog post.

like for example here:
http://dev.inbalancetaichi.com/news/

2.)
How can i display the date on a page, for some reason i'm getting this on the special page:

{i18n_specialpages/DATE_FORMAT}

here is my special page 'View' code:
Code:
<h3 class="blog-post-title"><?php get_special_field('title','',false); ?></h3>
        
                        <ul class="blog-post-info fixed">
                            <?php if (return_special_field('newsauthor')) { ?>
                            <li class="author"><?php get_special_field('newsauthor','-',false); ?></li>
                            <?php } ?>  
                            <li class="date"><?php get_special_field_date('pubDate', $dateFormat); ?></li>
                            <li class="categories">[insert special pages tags here]</li>
                        </ul>

<div>
<?php if (return_special_field('featuredimage')) { ?>
  <img src="<?php get_special_field('featuredimage','-',false); ?>" alt="featured image for <?php get_page_title(); ?> " class="featured-image" style="float:right;margin-left:10px;">        
<?php } ?>    

<?php get_page_content(); ?>
</div>

And on that same subject, is there a way to format the date to exclude the time?

thanks,

marc
Reply
#49
alienee2 Wrote:$dateFormat

looks like
$dateFormat is undefined
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#50
alienee2 Wrote:ISSUE:
- can't insert an image into a WYSIWYG special field.

I suppose you are using GetSimple 3.0: switch on site-wide cookies in gsconfig.php and use the new I18N Special Pages version 0.8.1.

alienee2 Wrote:How would i show the tags for a special page, say for example in the meta of a blog post.

The field is named tags and is an array of strings.
You can use
Code:
<?php echo implode(", ", return_special_field('tags')); ?>

alienee2 Wrote:How can i display the date on a page, for some reason i'm getting this on the special page:

{i18n_specialpages/DATE_FORMAT}

There was a bug, as it should show the date in a default format, if you don't give a date - use version 0.8.1.
(You specify a second parameter to get_special_field_date, but it's undefined - $dateFormat is only defined when displaying a search result)

alienee2 Wrote:And on that same subject, is there a way to format the date to exclude the time?

Add a second parameter - a format for the PHP function strftime - to get_special_field_date and don't include time place holders, e.g.
Code:
<?php get_special_field_date('pubDate', '%A, %B %e, %Y'); ?>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 1 Guest(s)