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.
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- internetking created topic »password problem« 25. May
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Answer:Clone a News module in Mynews
-
- Rank: Helper
- Registered: Sep 16, 2004
- Last visit: Oct 21, 2009
- Posts: 731
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
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. -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
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?
--
- Mateo T. -
Mis principios... son mis fines -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 32
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?
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. -
- Rank: Software Foundation
- Registered: Sep 03, 2002
- Last visit: May 09, 2010
- Posts: 909
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!" -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
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
--
- Mateo T. -
Mis principios... son mis fines -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 32
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 -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
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
Good luck
--
- Mateo T. -
Mis principios... son mis fines -
- Rank: Developer
- Registered: Mar 29, 2005
- Last visit: Mar 13, 2010
- Posts: 228
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 -
- Rank: Team Member
- Registered: Dec 07, 2003
- Last visit: May 09, 2010
- Posts: 2703
1. bug
2. feature request
3. I will do a lang review with Mateo. There should be consistency.
--
David Pahl
Zikula Support Team -
- Rank: Developer
- Registered: Aug 23, 2003
- Last visit: May 31, 2010
- Posts: 1428
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
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)
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
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
