Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Fields (and I18N)
If you change path to /admin in gsconf, you also have to change the paths in i18n plugins family manually.

edit: although in latest versions I think path to /admin isn't hardcoded
Addons: blue business theme, Online Visitors, Notepad
Reply
Ah right, will check that out then. Thanks.
Reply
(2012-12-20, 02:24:47)thedoglett Wrote: I've just found that when changing the path for the admin folder to something else, the customfields plugin files filebrowser.php and pagebrowser.php are not being bypassed and return errors in the chooser window

The plugin probably does not yet support changing the admin path. I'll try to include it in the next release.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Is it possible to use the same custom field multiple times in a template? I had thought to use a custom field to help define page specific styles, as well as return the page selected for the JS powered menu (so menu displays 'down button' for current page). The custom field works properly in the first application but then *nothing* returns for subsequent applications on the same page. I've turned debugging on, cookies are enabled.

Code for capital.php is as follows

Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); } ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php get_page_title();?></title>
<?php get_header(); ?>
    <link href="<?php get_theme_url(); ?>/styles.css" rel="stylesheet" type="text/css" />
    <link href="<?php get_theme_url(); ?>/styles.css" rel="stylesheet" type="text/css" />
    <!-- include jQuery and imagineMenu plugin -->
<script type="text/javascript" src="<?php get_theme_url();?>/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="<?php get_theme_url();?>/js/jquery.imagineMenu-1.1.js"></script>

    <script type="text/javascript" charset="utf-8">
$(function () {
    $('#firstNav').imagineMenu({image: '<?php get_theme_url();?>/img/menu.gif', link_widths: [64, 85, 81, 165, 146, 124, 115], selected:'<?php get_custom_field('pageon');?>'});
});
</script>
</head>

<body>
        <div id="container">
<?php

include('top-menu.inc.php');
include('logo-bar.inc.php');
include('capital-main.inc.php');
include('bottom-menu.inc.php');

get_footer(); ?>
    </body>
    </html>

Code for the capital.inc.php file is as follows
Code:
<div id="subheader">
       <?php get_custom_field('subheader');?>"
       </div>
    <!--Is this code live? Echo Pageon variable-->
<!--<?php get_custom_field('pageon');?>-->

    <div id="main<?php get_custom_field('pageon');?>">
        <div id="<?php get_custom_field('pageon');?>text">
        <img src="/images/<?php get_custom_field('pageon');?>heading.jpg" />
        <?php get_custom_field('blurb');?>
        </div>
        <div id="rtimg"></div></div>
        <div id="bottomtext">
        <?php get_page_content();?>
      </div>

The function 'firstNav' in the main template returns the custom field 'pageon' correctly. In the .inc.php file it is as if the content is not being returned at all and the file not being processed... I do not see the added HTML content. Is there a cacheing functionality that I need to disable or clear?

This is the customfields plugin not the special pages although I may switch (will I need to re-do anything?).

Thanks!

Diana

If you want to see the issue live, sitemail me. I don't want to have the client ever find this thread. ;-)
Reply
(2013-02-06, 03:48:04)dianajo Wrote: Is it possible to use the same custom field multiple times in a template?

Yes.

(2013-02-06, 03:48:04)dianajo Wrote: Code for capital.php is as follows

Code:
...
include('top-menu.inc.php');
include('logo-bar.inc.php');
include('capital-main.inc.php');
include('bottom-menu.inc.php');
...

Code for the capital.inc.php file is as follows
...
In the .inc.php file it is as if the content is not being returned at all and the file not being processed... I do not see the added HTML content.

If you don't include capital.inc.php, but rather capital-main.inc.php, it's no wonder you won't see it ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2013-02-06, 03:56:40)mvlcek Wrote: If you don't include capital.inc.php, but rather capital-main.inc.php, it's no wonder you won't see it ;-)

Typo/Error in the post, but not in the files, the file is capital-main.inc.php and is included.
Reply
I think I may have an ISP cacheing issue occurring. Haven't touched the site in an hour and 'suddenly' it works. Since, it's a foreign ISP (I'm traveling) I have no clue how to defeat it...I never have this problem in the states.
Reply
(2012-04-20, 04:32:51)mvlcek Wrote:
Angryboy Wrote:But (for me at least) it makes all links open in a new window (not just the external ones) because if the field 'link' is empty, the field takes the value of the actual link of the page. So in theory the field is always filled; as my IF statement depends on 'link' being either empty or full, the statement serves no real purpose.

(2012-04-20, 14:15:35)andyash Wrote: [quote=mvlcek]global $SITEURL;
... echo substr($item->link,0,strlen($SITEURL)) == $SITEURL ? '_self' : '_blank'; ...
mvlcek Wrote:<a href="<?php echo htmlspecialchars($item->link); ?>" target="_<?php if($item->link!=='') { echo 'blank'; } else {echo 'self'; } ?>">

How and where do I put these two to achieve my target?

I'm trying to get external links to open in a new window. Can anyone help with this method, where to use the global $SITEURL; bit?
Reply
Hello mvlcek,
Thank's for this awesome plugin.
One question : when I use the checkbox custom field, the display in a page is on. How can I modified this display to have yes, in exemple ?
Français et éternel débutant
French and eternal beginner
Reply
For my "problem", I just create a variable and I test it.
$promotion=return_custom_field('promotion');
<?php if(!empty($promotion) && $promotion=='on') {
echo "<p><strong>En promotion :</strong> Oui</p>";
} else {
echo "<p><strong>En promotion :</strong> Non</p>";
}
?>
Français et éternel débutant
French and eternal beginner
Reply
(2013-02-24, 20:30:41)krysttof Wrote: Hello mvlcek,
Thank's for this awesome plugin.
One question : when I use the checkbox custom field, the display in a page is on. How can I modified this display to have yes, in exemple ?

That's currently not possible. I'll add it to the to dos for the next version.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Is it possible to get a custom-field per page definition? Maybe like this:
PHP Code:
<?php get_custom_field('custom-field''page1'); ?>
<?php get_custom_field
('custom-field''page2'); ?>
<?php get_custom_field
('custom-field''page3'); ?>
Reply
Hello, mvlcek,

What about filtering by custom fields? Like example i need item filtering in catalog page by $price or name or ... Smile
Reply
Hey people!

I'm quite new to GetSimple or php at all, and I keep getting into trouble with this thing I'm trying to achieve with Custom Fields.

So I've got a static website which has a News page on it. The goal would be to create a system for my friends with no coding knowledge to add/edit news, and I chose GetSimple since its simple and fast. I've got News Manager (updated version) and Multi User plugin installed, and they're doing everything I want them to, except displaying the users name (not the username, but the real name of the user, Multi User has a field for this) who added the article.

I tried getting around Multi User since its only feature would be to display the username, which would cut back the site's security, no need to say. I installed Custom Fields and added a field "szerzo" (author in hungarian) and it displays well when I add it to a default GetSimple page, but the "szerzo" text field doesn't even show up in News Manager's editor.

Now I found a code snippet in admin/edit.php:
PHP Code:
<?php exec_action('edit-extras'); ?>

I copied it to the right place into my plugins/news_manager/template/edit_post.php

The textbox now shows up in the News Manager Editor, but whenever I try to display the author on my front page by:
PHP Code:
<?php get_custom_field('szerzo'); ?>

I get an error saying "undefinied variable".

I guess copying the exec_action code is not really enough to get it working... as I said, I'm new to php. If there is any way to do this, with or without Custom Fields, please let me know.

UPDATE: Nevermind, I solved the problem by manually adding a variable to News Manager's code.
Reply
how to display the date in Russian?
Code:
get_page_creation_date($i="l, F jS, Y - g:i A", $echo=true)
Reply
The plugin installed are:
I18N 3.0.5 , Dynpages 0.7.2, I18N custom field 1.8.4

I create a component theme called "test" as follow:
<label for="name" label="" style=<?php get_custom_field('mylabel'); ?>>Name</label>

And I create a custom field like this:
Name: mylabel
Label: clear: left;float: left;padding:3px 10px 2px;text-align: right;width: 180px
Type: Long text field

In the WYSIWYG editor I enter this:
{% test %}

But I cannot see the formatting. The get_custom_field didn't work.
I need help
Thanks in advanced
Reply
(2013-04-29, 18:43:38)zintonio Wrote: ...
I create a component theme called "test" as follow:
<label for="name" label="" style=<?php get_custom_field('mylabel'); ?>>Name</label>

And I create a custom field like this:
Name: mylabel
Label: clear: left;float: left;padding:3px 10px 2px;text-align: right;width: 180px
Type: Long text field
...

You are missing the quotes around the style attribute:
Code:
<label for="name" label="" style="<?php get_custom_field('mylabel'); ?>">Name</label>
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2013-04-29, 19:57:25)mvlcek Wrote:
(2013-04-29, 18:43:38)zintonio Wrote: ...
I create a component theme called "test" as follow:
<label for="name" label="" style=<?php get_custom_field('mylabel'); ?>>Name</label>

And I create a custom field like this:
Name: mylabel
Label: clear: left;float: left;padding:3px 10px 2px;text-align: right;width: 180px
Type: Long text field
...

You are missing the quotes around the style attribute:
Code:
<label for="name" label="" style="<?php get_custom_field('mylabel'); ?>">Name</label>

Thanks for reply,

It works only if I create a special page (with plugin I18N Special Pages). If I have a normal Page created before, nothing happen when I insert {% test %} although I insert the quotes to style="<?php get_custom_field('mylabel'); ?>". So my question is: why get_custom_field doesn't work in normal page? How can i solve?
Thanks in advance
Reply
(2013-04-29, 18:43:38)zintonio Wrote: I create a component theme called "test" as follow:
<label for="name" label="" style=<?php get_custom_field('mylabel'); ?>>Name</label>

And I create a custom field like this:
Name: mylabel
Label: clear: left;float: left;padding:3px 10px 2px;text-align: right;width: 180px
Type: Long text field

In the WYSIWYG editor I enter this:
{% test %}

I just saw that you totally misunderstand the plugin - which I overlooked in my first reply: label is the label of the field, not the content. If you define a custom field, each of your pages will have an additional entry field (labeled with the label) in the Page options. There you can enter the content of the field for this page. If you don't enter a content, the field is of course empty.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
(2013-04-30, 02:17:11)mvlcek Wrote:
(2013-04-29, 18:43:38)zintonio Wrote: I create a component theme called "test" as follow:
<label for="name" label="" style=<?php get_custom_field('mylabel'); ?>>Name</label>

And I create a custom field like this:
Name: mylabel
Label: clear: left;float: left;padding:3px 10px 2px;text-align: right;width: 180px
Type: Long text field

In the WYSIWYG editor I enter this:
{% test %}

I just saw that you totally misunderstand the plugin - which I overlooked in my first reply: label is the label of the field, not the content. If you define a custom field, each of your pages will have an additional entry field (labeled with the label) in the Page options. There you can enter the content of the field for this page. If you don't enter a content, the field is of course empty.

Thank you very much, yes I completely misunderstand the plugin, but now is totally clear.
Reply
Just tried to use this plugin on my fresh GS 3.2.1 install but won't allow me to activate it. It also gives an update message for the plugin.
Reply
(2013-05-12, 01:15:59)kolorguild Wrote: Just tried to use this plugin on my fresh GS 3.2.1 install but won't allow me to activate it. It also gives an update message for the plugin.

Which version do you use? It works for me.

I18N Custom Fields version 1.9:
  • supports a new field type "file", which allows you to browse all uploaded files
  • improves the WYSIWYG editor's page browser to work with I18N's fancy URLs (e.g. %LANGUAGE%)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi,
first thank you for this very, very useful plugin!
One question regarding the image type custom field variable.
It works great but returns the full http path to the selected file. I am developing my site on another domain then it will run later, so I have to change all paths manually later. I would prefer to use something like:
PHP Code:
<?php

   
// I defined a custom variable called "headerimage" 
   // Type of the variable is image
   
   // Instead of 
   
$myImage return_custom_field("headerimage");
   
   
// I would like to use something like
   
$myImage return_site_url() . return_custom_field('headerimage');

   echo 
"<img src='".$myImage."'>";
?>
I hope you understand what I want to say...
Is there a setting or option to receive relative paths from the image selector?

I could chop the first http-part from the result after fetching the var content, but I think it would be nicer, if it would be stored relative from the start.

Thanks for an answer!
Reply
(2013-06-13, 22:35:50)retrofan Wrote: Hi,
first thank you for this very, very useful plugin!
One question regarding the image type custom field variable.
It works great but returns the full http path to the selected file. I am developing my site on another domain then it will run later, so I have to change all paths manually later.

Currently, if you include links to other pages or include links in the WYSIWYG editor in GetSimple, you always get absolute links. Thus the custom field functions also return absolute links.

You can either patch the plugin or you can remove the server part of the custom field value in your template and add the correct site URL.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi,

(2013-06-13, 23:05:32)mvlcek Wrote: You can either patch the plugin or you can remove the server part of the custom field value in your template and add the correct site URL.

thanks for the fast answer! Okay, I will cut the server part in my script. No big problem. I just asked, because I thought there might be already an option somewhere in the settings to change this behavior.
Reply




Users browsing this thread: 1 Guest(s)