Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • degagee Friend
    #178995

    First to say: I really appreciate the JA-Wall idea and implemantation! Very good, innovative and extraordinary work…
    As I start playing around, one thing for me is missing: I would like to add “Extended Classes” to articles in front end editing. As it seams, this is only possible in back end editing. Can anyone implement this, because I think it could be a great feaure, expecially if you give the site to customers…

    Sherlock Friend
    #460798

    Hi degagee,

    You could try as following steps

    1) Open the file of componentscom_contentmodelsformsarticle.xml you add the below tag right above the tag of </form> at bottom

    <fields name=”metadata”>

    <field name=”robots”
    type=”list”
    label=”Robots”
    description=”JFIELD_METADATA_ROBOTS_DESC”
    >
    <option value=””>JGLOBAL_USE_GLOBAL</option>
    <option value=”index, follow”>JGLOBAL_INDEX_FOLLOW</option>
    <option value=”noindex, follow”>JGLOBAL_NOINDEX_FOLLOW</option>
    <option value=”index, nofollow”>JGLOBAL_INDEX_NOFOLLOW</option>
    <option value=”noindex, nofollow”>JGLOBAL_NOINDEX_NOFOLLOW</option>
    </field>

    <field name=”author” type=”text”
    label=”JAUTHOR” description=”JFIELD_METADATA_AUTHOR_DESC”
    size=”20″ />

    <field name=”rights” type=”textarea” label=”JFIELD_META_RIGHTS_LABEL”
    description=”JFIELD_META_RIGHTS_DESC” required=”false” filter=”string”
    cols=”30″ rows=”2″ />
    <field name=”xreference” type=”text”
    label=”External Reference”
    description=”COM_CONTENT_FIELD_XREFERENCE_DESC”
    class=”inputbox” size=”20″ />
    </fields>

    2) Then you open the file of componentscom_contentmodelsform.php adding this block of code
    [PHP] // Convert the metadata field to an array.
    $registry = new JRegistry;
    $registry->loadString($value->metadata);
    $value->metadata = $registry->toArray(); [/PHP]

    Right below this block
    [PHP]
    // Convert attrib field to Registry.
    $value->params = new JRegistry;
    $value->params->loadString($value->attribs);
    [/PHP]

    3) Finally You open the file of componentscom_contentviewsformtmpledit.php adding this block of code
    [PHP]
    <?php foreach($this->form->getGroup(‘metadata’) as $field): ?>
    <li <?php if($field->name !== “jform[metadata][xclass]”) { ?> style=”visibility:hidden;height:0px” <?php }?> >
    <?php if (!$field->hidden): ?>
    <?php echo $field->label; ?>
    <?php endif; ?>
    <?php echo $field->input; ?>
    </li>

    <?php endforeach; ?>

    [/PHP]
    Right below this code
    [PHP]
    <div class=”formelm-area”>
    <?php echo $this->form->getLabel(‘metakey’); ?>
    <?php echo $this->form->getInput(‘metakey’); ?>
    </div>
    [/PHP]

    Try it and let me know if it still does not help !

    degagee Friend
    #460995

    Hi Sherlock Holmes,
    thanks a lot for your suggestion.
    I made the change in the administrator/…/article.xml and the change in components/…/form.php, but there isn’t a “Exended Class” field.

    As I was playing around before I did my post here, I added a “extended” field in the file components/com_content/views/form/tmpl/edit.php this way:
    [PHP] <fieldset>
    <legend><?php echo JText::_(‘COM_CONTENT_METADATA’); ?></legend>
    <div class=”formelm-area”>
    <?php echo $this->form->getLabel(‘metadata_xclass’); ?>
    <?php echo $this->form->getInput(‘metadata_xclass’); ?>
    </div>
    <div class=”formelm-area”>
    <?php echo $this->form->getLabel(‘metadesc’); ?>
    <?php echo $this->form->getInput(‘metadesc’); ?>
    </div>
    <div class=”formelm-area”>
    <?php echo $this->form->getLabel(‘metakey’); ?>
    <?php echo $this->form->getInput(‘metakey’); ?>
    </div>

    <input type=”hidden” name=”task” value=”” />
    <input type=”hidden” name=”return” value=”<?php echo $this->return_page;?>” />
    <?php if($this->params->get(‘enable_category’, 0) == 1) :?>
    <input type=”hidden” name=”jform” value=”<?php echo $this->params->get(‘catid’, 1);?>”/>
    <?php endif;?>
    <?php echo JHtml::_( ‘form.token’ ); ?>
    </fieldset>[/PHP]
    Your suggestion does not work with my changes nor on a plain installation.
    Any more suggestions?

    Again: Thanks a lot, so far!

    Sherlock Friend
    #461105

    Hi degagee,

    Sorry for some mistakes I made on the above post, I have just updated it with some more changes, please try play with it again and let me know if it still does not work

    degagee Friend
    #461192

    Dear Sherlock Holmes,
    your changes were perfect, now it does the job!
    Perfect timing as well, tomorrow I’m going to present the system to a client and I’m happy to present it with this front end feature!
    SOLVED!

    Andrew Winkler Friend
    #478272

    I tried following your instructions above with the result that my page went blank every time I tried to edit an article from the frontend. If it’s not too much trouble, could you please create a zip file with the patched version of the files and link to them from this thread, plus instructions where to put them.

    Ninja Lead Moderator
    #478416

    You can download and extract three following files appropriate with path below:

    + components/com_content/models/forms/article.xml
    + components/com_content/models/form.php
    + components/com_content/views/form/tmpl/edit.php

    Remember to backup old files before overridding it(this customization appears with joomla2.5)

    You can see it on front-end site, see the screenshot


    1. Extended-Classes.zip
    boetco Friend
    #480620

    Hi guys,
    great post! very clear.

    Although it involves modifying core joomla files. Is it possible to do the same without any core modification?

    Thx for your help,

    Ninja Lead Moderator
    #480732

    <em>@boetco 356278 wrote:</em><blockquote>Hi guys,
    great post! very clear.

    Although it involves modifying core joomla files. Is it possible to do the same without any core modification?

    Thx for your help,</blockquote>

    Nope, because everything customized above is hacked to change on JOOMLA CORE , but you need to backup on this and compare it when you are doing to upgrade new version JOOMLA Core.

    archarank Friend
    #480753

    Question why some pictures are bigger?

    Ninja Lead Moderator
    #480822

    <em>@archarank 356469 wrote:</em><blockquote>Question why some pictures are bigger?</blockquote>
    I’m not sure what you are implying. Just for better clarification, please include screenshot and your site URL here for further investigation.

    stefane06 Friend
    #503465

    Hello,

    since JOOMLA 3.1 the Extended Class.zip you give as download breaks the editing template.
    Do you have a new version of this zip?

    N.B/ the JA WALL is really interesting! Bravo for the work 🙂

    Ninja Lead Moderator
    #503555

    You can follow the solution in this thread

Viewing 13 posts - 1 through 13 (of 13 total)

This topic contains 13 replies, has 7 voices, and was last updated by  Ninja Lead 11 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum