One profile, change filename depending on switch?

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

One profile, change filename depending on switch?

Postby NitroX_infinity » Thu Sep 27, 2007 10:17 am

Is it possible to make one profile output to different files depending on which category you select? (or another switch instead of category?)

Example;
On the same 'submit news' page; You select category 1 and the profile places the post in 1.html. You select category 2 and the profile places the post in 2.html, etc.

I'm only interested in changing the filename in the profile depending on a switch. The file path is the same.
User avatar
NitroX_infinity
 
Posts: 371
Joined: Fri Apr 04, 2003 7:36 pm
Location: The Netherlands

Postby SrNupsen » Thu Sep 27, 2007 11:19 am

Using the Maginot addon you can specify any Coranto field as part of the output profile. This is in the "File path" setting on the profile's settings page. Further down on that page, you have option for naming files according to Coranto fields (including custom fields).

Got it? :)
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby NitroX_infinity » Thu Sep 27, 2007 11:43 am

Working like a charm, thank you! :D

Except for deleting items. When I go into 'modify news' and delete an item from a MAginot profile, it only deletes the list entry, not the entry in the file. How do I solve this?
User avatar
NitroX_infinity
 
Posts: 371
Joined: Fri Apr 04, 2003 7:36 pm
Location: The Netherlands

Postby SrNupsen » Thu Sep 27, 2007 2:02 pm

The file itself as created by Maginot will not be deleted. However, if you do a full rebuild, all links to that newsitem should disappear, depending on how you set up your profiles.

Say you have a profile creating headlines for the 5 most recent news items. Once you delete a news item and do a full rebuild, it will no longer appear in the headlines. However, the HTML file will still exist on your server.

There have been suggestions earlier to have Maginot delete files, but this is dangerous approach (as there are plenty of nasty bugs that could happen) and no developer has wanted to go down that road yet!

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby SrNupsen » Thu Sep 27, 2007 2:04 pm

NitroX_infinity wrote:it only deletes the list entry, not the entry in the file.


To elaborate a little, this isn't entirely correct. The entry WILL be deleted from the news database (newsdat.txt), but the static HTML file that was created based on the entry will remain.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby NitroX_infinity » Thu Sep 27, 2007 2:34 pm

I don't need it to delete the file. I need it to delete the entry in the file.
I use this profile to post into sort of a flat-file database.

So if delete an entry in modify news, I don't need it to delete the entire static file :P
User avatar
NitroX_infinity
 
Posts: 371
Joined: Fri Apr 04, 2003 7:36 pm
Location: The Netherlands

Postby SrNupsen » Thu Sep 27, 2007 4:24 pm

If you use your profile to take the news item from newsdat.txt and re-post it into a nother flat-file database, then you'll need to deal with that separately.

Unless, ofcourse, the whole database is regenerated on every full rebuild. Then a full rebuild would suffice.
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 2 guests

cron