Fork me on GitHub

Answer:Clone a News module in Mynews  Bottom

  • I want to duplicate the news module and rename it in mynew
    Needed to force change all references with a value of 'news' in the various files that make it up or there is a way + fast?
    Obviously change the names of the tables.
  • You'll have to, at the minimum, change all the function names to coincide with your new name.

    Postnuke will look for function MODULENAME_TYPE_FUNCTION as in News_user_view

    Changing any template names (and calls to them in the code) and API functions as well.

    Permission checks will also need to be changed (ie, from NEWS:: :: to NEWNAME:: ::)

    Even then, you'll probably have several other variables and other little items that will need to be adjusting.

    Another thing to look at is if a pnRender cache instance is set - you'll need to make sure the cacheid's don't conflict with the original modules.

    It will be an involved process icon_smile

    I've been wanting to experiment with a module that could change names easily - to create two instances of it easily on a site.

    Mark West had a dynamod that would do that - rename the folder, and you have a new mod. It worked well for simple content that you could place and call within the dynamod files.
  • Hey Alverman!
    What's the purpose to have a cloned News module?

    You can change its display name and it changes the name displayed in the URL, or you want to have two News systems in your site? why?
    icon_confused

    --
    - Mateo T. -
    Mis principios... son mis fines
  • nestormateo

    Hey Alverman!
    What's the purpose to have a cloned News module?

    You can change its display name and it changes the name displayed in the URL, or you want to have two News systems in your site? why?
    icon_confused


    I would like to be able to change while maintaining the original modules news.
    I need a form that kind of news but with a date field inserted manually.
    The display of the news is based by date.
  • You could help Mateo with his work on the normal News module.

    --
    best regards from Kiel, sailing city

    Steffen Voss

    Member of the Zikula Steering Committee
    Read The Zikulan's Blog "If you want people to RTFM, make a better FM!"
  • So, alverman
    do you want to be able to modify the date from the edit form?

    Currently Erik Spaan and me, are the maintainers of the News module.
    I've applied some improvements to the module (are you working with the latest SVN copy?) and now all the features are working Ok.

    The programming articles feature doesn't solves your need?
    or you need to edit the dates of existing articles and it's impossible with the current form, so you want a clone?

    Just tell me some details,
    i'll see what can i do icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Congratulations for the module!
    Is very good with categorization !!
    I use RC3

    The module news works with the date and time automatically and news are shown in descending order according to date of incorporation.
    I need to manually enter the data.
    I would like to use the form to enter news events (shows, concert, ecc), in accordance with the date display.
    As the date change the event disappears from view showing the next.

    Thanks for interest !!

    Alverman
  • Ok alverman,
    i recommend you to update your site with the latest SVN snapshot. RC3 doesn't include some fixes in the Multi-Categorization filters and UI improvements for the News, Pages, FAQ, Feeds, Quotes and Reviews modules.

    And about "enter the data manually", why?
    i guess that you should set the time limit to your News articles, setting the expiration date to be automatically "removed" of the list.

    Try the Publishing options > Time limit in the edit/create form, and tell me if it can works in your case icon_wink

    Good luck

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Hi nestor,

    I don't know if it's a bug or a feature request, so I'm writing it here.

    I have 2 problems with the News modules:

    1. when you create a "News/Story Title" block you have to choose a Category... if you leave it blank, instead of displaying the news from all the category, the block it's not displayed at all. Is this correct?
    The category it's not mandatory (if you leave it black you won't get any error/warning)... IMHO it should display all the news, or at least display an error/warning.

    2. I created a "News/Past Articles" block, but it wasn't displayed. Reading the code I discovered that Past Articles displays the news from "Number of articles in news index" to "Maximum number of news items to list".
    I would have expected to display the news from "Number of articles on news front page" to "Maximum number of news items to list".
    Maybe it'd be useful to be able to choose it.

    And 3. (but that's not a problem :P )
    The module is called "News"
    The first block is called "Story Title"
    The second block is called "Past Articles"
    The third is called "Today big story"
    I think it could be a little bit confusing... a news user could think that Story/Article/News are different things (I'd do it... maybe it's due English it's not my first language, but I wouldn't use these terms like synonymous)
    Wouldn't be better to use only one name? (News)

    Bye, Giacomo

    --
    Zikula Italia
    SimpleGallery
  • 1. bug
    2. feature request
    3. I will do a lang review with Mateo. There should be consistency.




    --
    David Pahl
    Zikula Support Team
  • 1. Easily solvable. The default is not caught explicitly and the wrong category gets filtered, hence no articles so the block is empty.
    Changing

    Code

    $apiargs['category'] = array('Main' => $vars['category']);

    to the following

    Code

    if (pnModGetVar('News','enablecategorization') && $vars['category'] != 0) {
        $apiargs['category'] = array('Main' => $vars['category']);
    }

    will check for the default and list all cats then. Also included is a check if the categories are enabled. The defaultvalue is defined as 0 in the modify template.


    2. The past story block is indeed a candidate for an update. This thread already discussed the nr of articles unclarity. After the release of 0.8 the News blocks can be updated to be more consistent. See also 3) icon_wink


    3. suggestion:
    - module: News
    - block: Story Titles / News Articles
    - block: Past Story Titles / Past News Articles
    - block: Most Read Story / Most Read Article

    New or planned already, see also storiesext and the News NOC.
    - content plugin: News Articles
    - block: Story Titles Extended
    - block: Feature Story
    - content plugin: Feature Story



    edited by: espaan, Mar 26, 2008 - 10:48 AM

    --
    campertoday.nl, Module development, Dutch Zikula Community
  • 0 users

This list is based on users active over the last 60 minutes.