Martin Kerz | 1 Feb 21:44
Gravatar

How to apply data-rel to an anchor?

Hi there,

I try to apply a data-rel attribute to an anchor tag. I did the following in a custommarkup.php file

SDV($WikiStyle['jqdialoglink'], array('data-rel'=>'dialog', 'apply'=>'a'));

And tried the following syntax on my page:

* %jqdialoglink%[[PageActionsDialog1|This Page ]]%%

What I want to achieve is something like this:

<a class="wikilink" data-rel="dialog" href="/Wiki/PageActionsDialog1">This Page</a>

Unfortunately, the data-rel="dialog" isn't showing up. What am I missing here?

Thanks, as always, for your help!

Martin
Mike Turco | 2 Feb 08:29
Picon

Difficulty implementing fox forms

I'm new to pmwiki and am having a problem taking in the "big picture".
If someone could please tell me what I'm doing wrong with the
following, I'd appreciate it. I've been trying really hard to read
through the documentation, and have been through a lot of it, but I'm
slightly lysdexic (sic) and am having problems getting through it all.

I have a test site I've setup for learning purposes at
http://crm.miketurco.com . On that site I have the pmwiki basic
install, along with fox forms, fox edit and fox delete. I also have
fox contacts setup, which I'm using as an example as I learn.

Test site: http://crm.miketurco.com
Password: Test.Wiki.123 (which applies to read, write and admin).

What I'm trying to do is setup a simple, flat, business management
database. As I see things, PTV's are like data fields, groups are like
tables, pages are like records and pagelists are like queries.

If you click the link that says NewBill in the sidebar, a form comes
up. You can fill out the form and hit Submit, and the page gets saved
"somewhere". I assume that the page is being saved in the NewBill
group, but... I'm not 100% sure on that.

If you then click on the Payables link, you'll see that I have some
data posted by that form does come up. One record shows up in part,
and I believe the blank lines are records from that group that would
be displayed if I had set things up right.

In my efforts to do this, I have created the NewBill form as well as
the BillList under Site/LocalTemplates.
(Continue reading)

Hans Bracker | 2 Feb 11:29
Picon
Favicon

Re: Difficulty implementing fox forms

Hi Mike,

I did some changes on your test site, to get some basic functionality
working, like the target page creation. But much more needs to be done.
The Contacts recipe is a fairly complex design, and much needs to be
explained, if you want to successfully model your billing system on it.
I have not got time right now to go into details, I try to do so
later.

Each new contact is created as a page in wiki group 'Contacts'.

--

-- 
Best regards,
 Hans                            mailto:design <at> softflow.co.uk
Martin Kerz | 2 Feb 11:41
Gravatar

Re: How to apply data-rel to an anchor?

Okay, by adding

$WikiStyleCSS[] = 'data-rel';
$WikiStyleApply['a'] = 'a';

I get it to appear, but it is embedded in a style attribute, i.e., I now have:

<a class="wikilink" style="data-rel: dialog;" href="/Wiki/PageActionsDialog1">This Page</a> 

Am I on the right track?

Thanks a lot in advance!

Martin

Am 01.02.2012 um 21:44 schrieb Martin Kerz:

> Hi there,
> 
> I try to apply a data-rel attribute to an anchor tag. I did the following in a custommarkup.php file
> 
> SDV($WikiStyle['jqdialoglink'], array('data-rel'=>'dialog', 'apply'=>'a'));
> 
> And tried the following syntax on my page:
> 
> * %jqdialoglink%[[PageActionsDialog1|This Page ]]%%
> 
> What I want to achieve is something like this:
> 
> <a class="wikilink" data-rel="dialog" href="/Wiki/PageActionsDialog1">This Page</a>
(Continue reading)

Mike Turco | 2 Feb 23:02
Picon

Re: Difficulty implementing fox forms

Hi Hans,

Thank you very much! I really appreciate your help.

Here's what I'm trying to do: I'm an independent sales person of
sorts. I have a need for a really simple, flat database to enter
potential sales and track the sales process. Your contacts example +
the markthingsdone addons are my learning tools. The billing stuff and
the contact manager that are on the test site right now are things
that I'll use, but a simple sales tracking system is what I need right
now.

I took another/closer look at your contact application. There is, of
course, the need to install fox forms, fox edit and fox delete. The
contact application itself, though, is comprised of four files (as per
http://www.pmwiki.org/wiki/Cookbook/FoxContacts ).

Here is what I *think* I need to do if I am going to create a new
group called SalesOpportunities along with custom forms.

Contacts.php: provides permissions and also the "delete if empty"
code. I need to add a line in the middle for the new group.

Contacts.Contacts will be a new page such as
SalesOpportunities.SalesOpportunities, and I need to modify the
pagelist command.

Contacts.NewContact is the form for data entry (and editing?) So that
form needs to be modified by adding new fields and so forth. It also
needs to be moved to SalesOpportunities.NewOpportunity.
(Continue reading)

Hans Bracker | 2 Feb 23:28
Picon
Favicon

Re: Difficulty implementing fox forms

Mike, some more details:
In your NewBill form the target parameter needed modification.
You want the new page name be build from the "payee" and "amount due"
("totdue"). Because 'totdue' quite likely has a dot as decimal marker
in it, when Fox on form submission tries to create a valid wiki page
name, it will interpret the part before the dot as a group name, and
the part after as a page name, removing any spaces and url invalid
characters. I fixed that by specifying a foxgroup parameter, thereby
setting specifically the target group. The same consideration could
actually be made for FoxContacts, if dots are used in name fields.

The other main difference from your form to the FoxContacts
NewContact form is this:
The NewContact form acts in two ways:
1. it is used to add a new contact page, using a template.
2. it is used to edit an existing contact, called by a FoxEdit link.
The editing works by updating the PTVs of the page.
These two very different functions are combined in one form, and that
needs some specific syntax constructions.
The fox template '#new' on the ContactTemplates page is used to add
PTVs and also a lengthy (:include ContactTemplates#display ... :)
directive to each new contact page. If we wanted only PTVs
added, we would not need a template, but just need to set the names
of PTVs in a list with commas separating each name to a parameter
ptvfields=. Those PTVs could be hidden (default) or in some other
visible form, using parameter ptvfmt=text or deflist, or section.

So what is the purpose of (:include ContactTemplates#display .... :)
directive? It provides a way to display the 'data' of the PTVs in the
page. Basically it displays (includes) section #display from page
(Continue reading)

Hans Bracker | 2 Feb 23:54
Picon
Favicon

Re: Difficulty implementing fox forms

Hello Mike,

Thursday, February 2, 2012, 10:02:40 PM, you wrote:

> Contacts.php: provides permissions and also the "delete if empty"
> code. I need to add a line in the middle for the new group.

No, local/contacts.php only gets loaded for pages in group 'Contacts'.
so you need a copy with your new group name AND modify the
permission pattern (you could set all FoxPagePermissions in
config.php instead).
The $DeleteKeyPattern allows a Contact page to be deleted by the
foxdelete link: the foxdelrange link deletes all from mark #foxbegin#
to mark #foxend#, and since this is the entire 'data entry', the page
content will by null. With the $DeleteKeyPattern of Contacts.php
PmWiki interpretes saving an empty page as deleting it (rather than
having to enter 'delete' as page content).

> As far as the edit links are concerned, I'll need to go back through
> "recent changes" and see what you've done to modify (I think) the
> template file in Contacts.NewContacts. The edit feature is something I
> do want to have in the "database", but its not the first priority.

What I did earlier on your test wiki is adding an edit link to the
pagelist template for the Bills pagelist (on Site.LocalTemplates).
This is  a standard pmwiki edit link, not foxedit functionality.
But a FoxEdit link could be used in the pagelist template just as
well, provided it calls the right edit form.

~Hans
(Continue reading)

Petko Yotov | 3 Feb 09:32
Picon

Re: How to apply data-rel to an anchor?

You need the following code in config.php :

  $WikiStyleAttr['data-rel'] = 'a';
  $WikiStyle['jqdl']['data-rel'] = 'dialog';

Then you can use %jqdl%[[link]]%%  or  %data-rel:dialog%[[link]]%%
to produce a link with an attribute  data-rel="dialog".

Petko

On Thursday 02 February 2012 11:41:28, Martin Kerz wrote :
> Okay, by adding
> 
> $WikiStyleCSS[] = 'data-rel';
> $WikiStyleApply['a'] = 'a';
> 
> I get it to appear, but it is embedded in a style attribute, i.e., I now
> have:
> 
> <a class="wikilink" style="data-rel: dialog;"
> href="/Wiki/PageActionsDialog1">This Page</a>
> 
> Am I on the right track?
> 
> Thanks a lot in advance!
> 
> Martin
> 
> Am 01.02.2012 um 21:44 schrieb Martin Kerz:
> > Hi there,
(Continue reading)

Martin Kerz | 3 Feb 12:21
Gravatar

Re: How to apply data-rel to an anchor?

Thanks a lot. That worked like charm.

If I might ask another question. What would I have to do if I wanted to be able to apply, say "data-rel" to
different tags., and specify it in the wiki source:

In your example, I would like to be able to say: 

%data-rel=dialog apply=div%

or

%data-rel:dialog apply=a%

Is that possible, too?

Again, thanks a lot.

M.

Am 03.02.2012 um 09:32 schrieb Petko Yotov:

> You need the following code in config.php :
> 
> $WikiStyleAttr['data-rel'] = 'a';
> $WikiStyle['jqdl']['data-rel'] = 'dialog';
> 
> Then you can use %jqdl%[[link]]%%  or  %data-rel:dialog%[[link]]%%
> to produce a link with an attribute  data-rel="dialog".
> 
> Petko
(Continue reading)

Petko Yotov | 4 Feb 00:52
Picon

Re: How to apply data-rel to an anchor?

On Friday 03 February 2012 12:21:21, Martin Kerz wrote :
> In your example, I would like to be able to say:
> 
> %data-rel=dialog apply=div%
> %data-rel:dialog apply=a%
> 
> Is that possible, too?

No, sorry, I don't see how.

Petko

> Am 03.02.2012 um 09:32 schrieb Petko Yotov:
> > You need the following code in config.php :
> > 
> > $WikiStyleAttr['data-rel'] = 'a';
> > $WikiStyle['jqdl']['data-rel'] = 'dialog';
> > 
> > Then you can use %jqdl%[[link]]%%  or  %data-rel:dialog%[[link]]%%
> > to produce a link with an attribute  data-rel="dialog".

Gmane