Personal wiki: changing the names of several pages - mediawiki

In my wiki I sent in a request to add a new namespace called 'Exchange', however adding the new namespace will delete all pages with the name 'Exchange:blahblah'. So I would need to change the page name for all these pages before requesting to add the namespace. The problem is that there are just under 1000 pages such as 'Exchange:blahblah' and changing the names of all of them would take up too much time.
My question is how, if possible, can I change the names of all these pages without having to manually alter the name individually. That is, if I wanted to change every exchange page from 'Exchange:blahblah' to 'Exchange1:blahblah', then is there a quick and easy way to change them all. All the pages are under the same category, if that helps.
Any advice would be greatly appreciated.

Add the namespace then run php maintenance/namespaceDupes.php --fix --move-talk from shell. See its documentation for details.

Related

generating two files by using workflows in Teamsite

I need your help/suggestion in teamsite(V6.7) coding for generating two files by using workflows means "How to generate a page at two different locations (in same branch) by using two different tpl files(desktop.tpl and mobile.tpl) but same DCR(abc.xml)"
I also guessed the idea/scenario that if any Perl script can be added in existing Workflow and while submitting the desktop file by using workflow to desktop location (/servername/default/main/sitefoldername/desktopsite/) then this workflow will also generate the same named file in mobile location(servername/default/main/sitefoldername/mobilesite/mobilepages/)
Please let me know if this kind of script can be developed
It would be a great help for me if you can provide your best solution into this.
Update the {iw-home}/local/config/templating.cfg to include the multiple presentations, one for each of your tpl file. You can use formAPI to set the location of the generated files.
Regards!
Yes, you can definitely generate two pages at a time.
You need to update the "templating.cfg" file and add all the different .tpl file names that you want to use but after doing this just try to generate some files using UI to cross check whether you are able to get the options for tpl selections if yes then you can proceed with the coding stuff. Also, you can refer some of these files: iwgen.ipl, iwpt_compile.ipl, iwtmplconfig.ipl and iwregen.ipl.
Please mark the solution and vote if it is useful.
Thanks!

Rename Taxonomy label in editor bolt-cms

I would like to rename the default tab value of Taxonomy in the backend page editor. I didn't find anything in the twig or yml files that would address this. Any ideas?
I checked with bolt developers and there is no way currently to do this. One potential option was to use the messages file but it was not recommended.
As you can imagine, since this isn't supported via the public configs, this will need a bit more advanced plugging together.
Here is a way to add an additional resource to the stack of translations.
https://gist.github.com/rossriley/c74fdee4fec3eaffb12f
This is a technique to add your own messages onto the translation stack without touching the underlying core files.
After creating this, you'll need to add your new service provider to the app, which you normally will bootstrap either in your index.php or a custom bootstrap file.

Mediawiki custom namespaces id change

I am currently working on an internal Mediawiki and we are using a lot of custom written extensions.
Because we did no know better, defined custom namespaces for our own extensions and articles with an id that is smaller than 3000.
For example:
define('NS_bla', 1100);
$wgExtraNamespaces[NS_bla] = "bla";
define('NS_bla_TALK', 1101);
$wgExtraNamespaces[NS_bla_TALK] = "bla Talk";
We did this with several different extensions. Now we read on the official documentation (http://www.mediawiki.org/wiki/Extension_default_namespaces) that custom namespaces should use id's that are 3000+.
Therefore my question: How can we easily change the IDs of the namespaces on the production instance, without messing up with our current dataset? How could we tackle this problem? I could not find any information on the Mediawiki documentation.
Thank's a lot in advance and
Cheers from Germany,
Fabian
To answer the question, you would need to update the page table with the new namespace ID:
http://www.mediawiki.org/wiki/Manual:Using_custom_namespaces#Use_a_database_query
To fit this to your occassion, it would be:
UPDATE page
SET page_namespace = 3000
WHERE page_namespace = 1100
You shouldn't have to replace the page_title since these articles are already in another namespace.
Just please remember to back up your database before trying this.

rename an html page according to an image within it

firstly I'll give some background regarding the situation.
I have a website containing approximately 56k pages each page contain a mapped sketch of a machine part. this machine part is made out of smaller parts which are outlined in the image and hold a certain number. when you hover over the numbers a box with the part item code shows up.
I order parts according to this item codes but recently a lot of the items codes have changed, therefore I am looking for a solution.
now I own a database with data on all the 56k parts and I want to link the relevant webpage to each record according to the name of the part(a column in my database), the problem is that the webpages names has no logic name that could connect with the part name in any way but the image that is displayed in the page has the exact name of the part.
I want to rename all the html files I has according to the Images displayed within them. how can I achieve that without renaming all the 56k pages manually?
additionally how can I add the links to all the 56k pages automatically to my database after all the above is done?
Thank you for your patience I know it was long.
If you have a *nix shell, then a simple egrep will get you far
egrep "<img src=\".*\"" -r . > list
The regexp would have to be adapted to match the part you are looking for of course.
You could easily to some search/replace in the resulting list to create a batch script that will do all the renaming for you.
Pick your favorite scripting language and parse each html file to find the image name to use in renaming the file. Personally I would use Perl as it makes parsing the files and updating a database at the same time with the URL easy.

New to CakePHP -> How To Add Columns To a MySQL Table?

I had a website made for me a long time ago, and the programmer did it in CakePHP. I'm now editing his scripts.
I added a couple columns to a table, and found that doing saveField() on the new column does not do anything. How do I make CakePHP recognize the new columns?
I'd appreciate your help. I'm not too familiar with CakePHP, so please go easy on me =)
The cache data is saved in YourAppFoloer/tmp/cache/models (delete the files there-in)
You can also try Cache::clear()
http://book.cakephp.org/view/1382/Clearing-the-Cache
Edit - this looked horrible in the comment:
You could add it to a controller to call:
function superHandyCacheClearer() {
$this->autoRender = false;
Cache::clear();
}
And call www.yourcakeapp.com/yourControllerYouAddedItTo/superHandyCacheClearer - but really, this is when you're making changes whilst in the code. Deleting the cache folder contents, really, should be the fix
make sure that the cache folder is still laid out like it was initially
cache
models
persistent
views
And that they are all 'writable' by the webserver, also note that unless you are running with a debug level of 0 some cache files may not be created every request. But remember that anytime you alter the model files or the database itself you should clear the cache/models folder.
HTH