Search

Are you 100% definitely signed in as a member?

So params only appear if I'm logged in.. ok cool, using a login form like this:

http://getsymphony.com/discuss/thread/70378/#position-17

Where element_name for Username is set to the name of my field staff-username and staff-password.. throws a wobbly.

    XSLTProcessor::importStylesheet(): Invalid expression
XSLTProcessor::importStylesheet(): Attribute template name: failed to compile Member: Username staff-username
XSLTProcessor::importStylesheet(): Invalid expression
XSLTProcessor::importStylesheet(): Attribute template name: failed to compile Member: Password staff-password
XSLTProcessor::transformToXml(): No stylesheet associated to this object

Any pointers?

EDIT

EventEx is in use on the Event so maybe fields needs to be changed to refer to the members section "Staff" no?

<input name="fields[{Member: Username element_name}]" type="text" />

Would read:

<input name="fields[staff-username]" type="text" />

EventEx is in use on the Event so maybe fields needs to be changed to refer to the members section "Staff" no?

EventEx has never been used with this Members extension, so bizarre results are to be expected. If you can avoid EventEx you probably should, instead favouring Brendan's tutorial for manually customising events which is what EventEx does anyway.

Ok cool, thanks Nick, the fields entries are correct, it's just not finding the Members data.. so I gues I'll try an event that isn't using EventEx to compare.

cheers.

EDIT

I get same result using a standard event.. My login form is placed in the maste-enquiry.xsl that's matched to "/", so I can't see why it wouldn't trigger.. Does being logged in the backend as admin make any difference? i.e is it not possible to check members functionality while logged in as admin?

i.e is it not possible to check members functionality while logged in as admin?

Nope, the two are entirely separate concepts.

Why would this code throw an invalid expression error?

It's just the code taken from the Readme with my Members section fields appended where needed.

    <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:import href="../utilities/master.xsl"/>

<xsl:output method="xml"
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    omit-xml-declaration="yes"
    encoding="UTF-8"
    indent="yes" />

<xsl:template match="data">
<form method="post" autocomplete='off'>
    <label>Username
        <input name="fields[{Member: Username staff-username}]" type="text" />
    </label>
    <label>Password
        <input name="fields[{Member: Password staff-password}]" type="password" />
    </label>

    <input name="redirect" type="hidden" value="{$current-url}" />
    <input name="member-action[login]" type="submit" value="Login" />
</form>

<form method="post" autocomplete='off'>
    <input type='hidden' name='redirect' value='{$current-url}' />
    <input name="member-action[action]" type="submit" value="Logout" />
</form>
</xsl:template>

</xsl:stylesheet>

The curly brace syntax is invalid. If you want curly braces to appear in your HTML source you'll have to use double braces {{ and }}. Anything between the braces is evaluated by XSLT, which is causing an error. See my earlier post about the correct attribute values.

<label>Username
    <input name="fields[{Member: Username staff-username}]" type="text" />
</label>
<label>Password
    <input name="fields[{Member: Password staff-password}]" type="password" />
</label>

Would be

<label>Username
    <input name="fields[staff-username]" type="text" />
</label>
<label>Password
    <input name="fields[staff-password]" type="password" />
</label>

Sorry guys I took the code is literal, and cos curly braces were in there, I assumed they were required to trigger correctly.

They call me muppet for a reason.

They call me muppet for a reason

Because of your charm and adorable looks.

No I actually look like a muppet.. The one who plays the Sax :)Minton the Muppet

lolz

Tx brendo, the members extension works fine.

But I wonder if it is meant to remove the handle concerning the username field.

I simply cannot use select box link based on username field and to get an entry related to members section. I use username instead of username/@handle which is the syntax used on all other select box links to get the main entry. On the end, this leads to avoid having a space on username for sure.

Bug or not :P ?

P.S: I have now a working forum with many features but still have a lot to do :) http://www.fun-plus.net/features/

Is there any more data expected to be output in events/member-login-info = success?

i.e I'm trying to submit the loggedin members name along with a form, by doing it in a hidden field so they don't have to select themselves as the person submitting, it does it for them.. I have the Staff datasource attached to the page so get the Staff names and other data... all I need is to match the $member-id to the logged in member ID right? what's the best approach syntax wise to do this?

 <input name="job-enquiry[fields][submitted-by]" type="hidden" value="data/staff/@id/staff-name = $member-id" size="30" />

Haven't quite mastered what needs doing to link variable to section id yet.

No worries, filtered DS on $member-id and referenced staff/staff-name/@value in input Field! woop :)

I also noticed what @Aluminium noticed, there is no handle for usernames... I'm guessing usernames aren't allowed to have spaces in them? But it does present a minor problem with caps. For example I wanted to make a friendly "profile" kind of page that looked like:

http://whatever.com/profile/username/

But all I seem to be able to achieve is:

http://whatever.com/profile/UserName/

When someone uses caps... Not a huge deal, but worth noting.

The only way I could see you being able to use lowercase username is have a section field called: username in your members Section. and filter the DS on the value username.. but this does not address the lack of availability of the handle in the XMl.

It's a bug, the Member: Username field should accept Usernames with spaces, and handles should be output on the Member: Username field.

EDIT Issue #157

I just started a new project which will rely on this extension, so thanks a lot for your hard work Brendo!

I have read the wiki, installed the extension and michael-e's utilities and everything works great so far. But I have one question. I was expecting to find this information easly but haven't so far.

How can I restrict pages and make automatic redirects? Is there an easy way to do that? Is my only option to have a choose/when/otherwise in my xslt to display such and such part of pages? For exemple I would like people to be redirected to the login page if not logged.

I have seen some interesting functions in the member api, do I need to create an extension?

thanks for your help.

How can I restrict pages and make automatic redirects?

You can assign Roles to Members, which includes the general public. If you make the member's pages not accessible by the Public role, Members will redirect these users to your site's 403 page

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details