Forum » Hidden / Per page discussions » Extended NewPage Module
Started by: Wikidot
Date: 06 Feb 2010 07:28
Number of posts: 46
rss icon RSS: New posts
This is the discussion related to the wiki page Extended NewPage Module.
page 1 of 21
pieterh pieterh 06 Feb 2010 07:50

Wow… looking forward to seeing this in action, James.

by pieterh pieterh , 06 Feb 2010 07:50
GoVegan GoVegan 11 Feb 2010 08:49

It's finally finished. If it were possible to specify static templates via the URL, I'd have done that too. That is the only feature that the inbuilt NewPage module has over this extension.

by GoVegan GoVegan , 11 Feb 2010 08:49
leiger leiger 04 Apr 2010 16:12

Uh… what the … o.O

I just noticed this as I'm going through my backlog of emails. This. Sounds. Incredible.

* goes off to test it out *


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

Last edited on 04 Apr 2010 16:12 by leiger
by leiger leiger , 04 Apr 2010 16:12
Feature requests
leiger leiger 04 Apr 2010 16:24

Request #1: Open in new windows/tab

It would be better if I could force the new page to be created in a new window/tab. Could you add that option?

Request #2: The ability to specify default text for the textbox

It'd be great to be able to specify some default text for the box… if that is possible.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

Last edited on 04 Apr 2010 16:27 by leiger
by leiger leiger , 04 Apr 2010 16:24
Re: Feature requests
GoVegan GoVegan 07 Apr 2010 06:22

Thanks for the suggestions Shane… they're good ideas, and I'll work on them.

by GoVegan GoVegan , 07 Apr 2010 06:22
Re: Feature requests
GoVegan GoVegan 19 Oct 2010 10:37

It took a while, but I've finally integrated the features you requested :-)

The reason it took me a while was because I decided to re-write the entire Javascript code — I made it unnecessarily complicated in the first place. Simplifying the code also removed all of the bugs in it too :-)

by GoVegan GoVegan , 19 Oct 2010 10:37
Re: Feature requests
(account deleted) 20 Oct 2010 00:51

The new features are great!

I'm having a bit of a problem trying to figure out how to tweak the css of the input box default text. I'd like to darken it up a pinch or two, but can't quite get the element ID'ed properly. For example if I put style=color: #444; background-color: red; into the module parameter list, I don't see the default text change, but I do see a red border inside the input box. It seems that a white text background is coming from somewhere (my own css perhaps). Using Firebug, I see that the CSS is applied to the iframe element, but I think what I'm looking for needs to apply to the form element.

@James, can you document this a bit more with a list of attributes we can tweak? BTW, it's nice to see you active again!

Thanks,
Ed

by (account deleted), 20 Oct 2010 00:51
Re: Feature requests
leiger leiger 20 Oct 2010 04:22

Thanks! Will be trying them out now.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 20 Oct 2010 04:22
Re: Feature requests
GoVegan GoVegan 20 Oct 2010 12:30

Cheers guys! Glad you like it :)

@Ed, I manually darkened the text for you (#666), and I fixed the TextBox to have a transparent background (so now you can set the background colour yourself)… but dynamically changing the font style/colour is something that is a bit too complex for my limited spare time at the moment. Sorry!

However, when it gets done, it will be via specifying a CSS stylesheet to run with the module.

by GoVegan GoVegan , 20 Oct 2010 12:30
Re: Feature requests
(account deleted) 21 Oct 2010 15:48

OK, thanks for the tweak. It looks a lot better. After posting, I did see where the styling was done, but now that you've changed it, I won't have to mess with it. I'm helping another user set up multiple sites and am making great use of your talents with this and the SUO snippet.

Thanks again,
Ed

by (account deleted), 21 Oct 2010 15:48
Something a little different.
HobStarCS HobStarCS 24 Apr 2010 10:17

Is it possible to have just a button with no textbox?

Scenario:
I am working on a Customer Management wiki (sorry it's closed to all but a few) [leiger and RhombusP have access.] In a Customer Record, I want a button that adds a new Work Order, as I already have set up auto-numbering and Page title format:[WO #%d] I do not need the NewPage button to have a text field as it's title is automated.

I have other senarios like; adding PC Details to a Cusotmer, adding Labour to a WorkOrder, etc, all of which do not really need to have text fields IF I'm using auto-numbering.

Current Use: Currently I'm using this;

[[module NewPage category="wo" button="Add Work-Order" parent="%%fullname%%" tags="open" align="left" size="15" preview="true"]]

What I'm Trying To Achieve:
Button + AutoNumbering + NewPage - Text Field

Thanks in advance
~ Paul

by HobStarCS HobStarCS , 24 Apr 2010 10:17
Re: Something a little different.
GoVegan GoVegan 24 Apr 2010 14:05

The NewPage Module is only useful for creating data based on the user's input.

What you are trying to achieve doesn't need User Input… so you can drop the idea of using a NewPage Module entirely.

Edit: See here for the solution to your problem.

Last edited on 25 Apr 2010 01:12 by GoVegan
by GoVegan GoVegan , 24 Apr 2010 14:05
Re: Something a little different.
leiger leiger 24 Apr 2010 14:12

You can do that with just a simple link… but James has posted an even better solution — using a simple link + adding CSS to make it look like a wikidot button.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 24 Apr 2010 14:12
Re: Something a little different.
GoVegan GoVegan 25 Apr 2010 01:08

Hey Paul,

I went that one step further for you… and created the NewPage Button.

This should make things MUCH easier for you, as the syntax is virtually the same as the NewPage Module. Just to prove my point, I will use the example you provided me above with the NewPage Button:

[[include :snippets:newpage-button NewPage
|category=wo
|name=new-page
|parent=%%fullname%%
|tags=open
|button=Add Work-Order
]]

The reason I did this is because you brought to my attention that this is something lacking in Wikidot. There's no easy way to create a NewPage link without having to learn the URL syntax… until now :D

Hope you like it.

by GoVegan GoVegan , 25 Apr 2010 01:08
Re: Something a little different.
HobStarCS HobStarCS 25 Apr 2010 07:32

It's good to know that in between my incoherent babble, sometimes something makes sense. ;)

I'll be trying it out later, will post back. I'll be using this a lot! Thanks.

by HobStarCS HobStarCS , 25 Apr 2010 07:32
Re: Something a little different.
GoVegan GoVegan 25 Apr 2010 08:22

Actually, you were just trying to articulate something that you needed, but didn't exist yet…

That's the challenge for all programmers… trying to find solutions to problems that shouldn't exist.

by GoVegan GoVegan , 25 Apr 2010 08:22
Re: Something a little different.
HobStarCS HobStarCS 25 Apr 2010 11:34

Yes, my brain works in interesting ways sometimes. :p

I tried it out and it REALLY does the job. Great work.

by HobStarCS HobStarCS , 25 Apr 2010 11:34
Re: Something a little different.
HobStarCS HobStarCS 25 Apr 2010 12:49

I like it a lot! Appreciate it. :)

by HobStarCS HobStarCS , 25 Apr 2010 12:49
Extended New Page Module and Data Forms
RobElliott RobElliott 08 Jun 2010 13:02

You might wish to be aware that if the extended newpage module is opening a page with a data form in the live template, the syntax must include name=something. If you omit this a normal page editor is opened and not the data form.

Sorry I should have posted in the extended newpage button page


Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.

Last edited on 08 Jun 2010 13:18 by RobElliott
by RobElliott RobElliott , 08 Jun 2010 13:02
Re: Extended New Page Module and Data Forms
leiger leiger 08 Jun 2010 13:15

Interesting. Is this the only way to directly edit a page that has a data form in the live template?


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 08 Jun 2010 13:15
Re: Extended New Page Module and Data Forms
RobElliott RobElliott 08 Jun 2010 13:20

No you can edit it in the normal way. I was trying to create a data form page using the extended newpage button (hence I posted on the wrong page). It works fine as long as you have name= in the syntax. I can't seem to get the non-button version to work with data forms in live templates at the moment. I must be doing something silly.


Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.

by RobElliott RobElliott , 08 Jun 2010 13:20
Re: Extended New Page Module and Data Forms
GoVegan GoVegan 08 Jun 2010 13:48

Hi Rob!

Yes, you need to have the |name= variable equal something. If you don't put anything in the |name= field, then the url will look something like this:
URL Interpreted as this
site.wikidot.com/data-form-category: site.wikidot.com/data-form-category

So you see, when you saw the normal editor instead of the data form, you were actually editing a page in the :_default category (which isn't a data form category).


This is also the same with autonumbered categories. You need to specify a page name to create the page (the page name is then changed to a number).

Does this help you a bit?

by GoVegan GoVegan , 08 Jun 2010 13:48
Re: Extended New Page Module and Data Forms
leiger leiger 09 Jun 2010 01:03

No you can edit it in the normal way.

When I click edit, I'm presented with a data form. If I create a new page either by link or the NewPage module, I'm presented with a data form.

I didn't think that it was possible to edit a data-form-templated page without having to go through the data form to do it.


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 09 Jun 2010 01:03
Re: Extended New Page Module and Data Forms
GoVegan GoVegan 09 Jun 2010 10:26

I didn't think that it was possible to edit a data-form-templated page without having to go through the data form to do it.

You can't, it's not possible. I wasn't clear enough:
Page Description
start the page "start" is in the "_default" category
start:now the page "now" is in the "start" category
start: the page "start" is in the "_default" category
by GoVegan GoVegan , 09 Jun 2010 10:26
Re: Extended New Page Module and Data Forms
leiger leiger 09 Jun 2010 10:38

Yes I understood what you were saying perfectly James :)

I was replying to Ed in my post (which is why I quoted part of his post)


~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server

by leiger leiger , 09 Jun 2010 10:38
RobElliott RobElliott 08 Jun 2010 14:48

Have you done something to break this snippet James? At the page here I just get a "No such page" error message whenever I try to create a page using

[[include :snippets:newpage
|category=acquisitions
|name=acquisition
|tags=2004
]]

It should create a page with a dataform on it. I tried it on another site with a standard page but still get that message. I'll go back to using the buttons for the time being.


Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.

by RobElliott RobElliott , 08 Jun 2010 14:48
GoVegan GoVegan 09 Jun 2010 00:10

Sorry, I was trying to add functionality, but I failed. Reverted to old version for now.

by GoVegan GoVegan , 09 Jun 2010 00:10
RobElliott RobElliott 09 Jun 2010 09:33

Thanks James, that's now working well.


Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.

by RobElliott RobElliott , 09 Jun 2010 09:33
bcammo bcammo 08 Sep 2010 09:24

This may be blatantly obvious, but it was a big 'ah hah!' moment for me…

If you want the user's input to also be created as a page tag, just put:

[[include :snippets:newpage
|tags=#
]]

This is particularly useful for selecting pages with the ListPages module. And it just made my life a whole lot easier.

Cheers,
Bryce

by bcammo bcammo , 08 Sep 2010 09:24
bcammo bcammo 24 Nov 2010 06:16

James (or other guru), is it possible to include the current date and/or time in the url output?? So that if the user's input is this is my page, the url becomes something like…

http://www.wikidot.com/2010-11-24-this-is-my-page/edit/true/title/this-is-my-page

Thanks,
Bryce

by bcammo bcammo , 24 Nov 2010 06:16
GoVegan GoVegan 01 Dec 2010 12:29

Sorry, I don't think that is possible…

by GoVegan GoVegan , 01 Dec 2010 12:29
bcammo bcammo 01 Dec 2010 12:37

Oh really? Well how about this then! Ah ha!

May I warn you to prepare to cringe at my very rudimentary, nigh nearly non-existent Javascript skills. Yet my determination to make this work somehow produced a semi-alright result. Critique welcome…

by bcammo bcammo , 01 Dec 2010 12:37
GoVegan GoVegan 01 Dec 2010 19:50

Oh sorry! I misunderstood you! I thought you meant creating pages based on the current page's creation date!

Very neat and tidy javascript, by the way :)

by GoVegan GoVegan , 01 Dec 2010 19:50
Question: ist it not a good idea to BLOCK the pages?
Helmut_pdorf Helmut_pdorf 30 Nov 2010 12:59

I have the feeling - all CSI-used "snippets" ( and their codes) should be blocked by the authors when working well and sre finished in the creating setup - to make them secure against trolls or changes wihtout any need…
Means - even a new version by the author himsels should be copied to a new version-numbering to secure the running version of codes?

What is your oppinion?


Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.

Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?

by Helmut_pdorf Helmut_pdorf , 30 Nov 2010 12:59
Re: Question: ist it not a good idea to BLOCK the pages?
GoVegan GoVegan 30 Nov 2010 13:21

Hmm.

I suppose restrict the permissions to "only edit pages owned by me". That way anyone can create pages, but they can't edit other people's pages. Perhaps only members of Snippets should be able to edit other people's snippets.

This is a good idea, seeing as some of the CSIs here are quite heavily used.

by GoVegan GoVegan , 30 Nov 2010 13:21
Minor Improvement
GoVegan GoVegan 01 Dec 2010 12:33

I noticed that in cases where the user types in a regular expression that is incorrect, the module will fail to work when the user submits the input.

Now there is an implemented solution to this: an error message lets the user know that an invalid regular expression was used to construct the module.

by GoVegan GoVegan , 01 Dec 2010 12:33
page 1 of 21
/forum/t-217126/extended-newpage-module#post-
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).

AltStyle によって変換されたページ (->オリジナル) /