Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid markup in Aldine #287

Open
SteelWagstaff opened this issue Nov 5, 2021 · 1 comment
Open

Invalid markup in Aldine #287

SteelWagstaff opened this issue Nov 5, 2021 · 1 comment
Labels
a11y This is an accessibility issue bug Something isn't working

Comments

@SteelWagstaff
Copy link
Member

SteelWagstaff commented Nov 5, 2021

  1. The contact form on the Aldine home page produces HTML validation errors because of how it handles the value property on the input fields.
    Screenshot from 2021-11-05 12-18-00

See

class="error"<?php endif; ?> type="text" name="visitor_name" value="
<?php
if ( $contact_form_response['status'] === 'error' ) :
echo $contact_form_response['values']['visitor_name'];
endif;
?>
" required>
<label for="contact-name">
<?php _e( 'Your name (required)', 'pressbooks-aldine' ); ?>
</label>
</p>
<p class="form__row">
<input id="contact-email"
<?php
if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_email' ) :
?>
class="error" <?php endif; ?>type="email" name="visitor_email" value="
<?php
if ( $contact_form_response['status'] === 'error' ) :
echo $contact_form_response['values']['visitor_email'];
endif;
?>
" required>
<label for="contact-email">
<?php _e( 'Your email address (required)', 'pressbooks-aldine' ); ?>
</label>
</p>
<p class="form__row">
<input id="contact-institution"
<?php
if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'visitor_institution' ) :
?>
class="error" <?php endif; ?>type="text" name="visitor_institution" value="
<?php
if ( $contact_form_response['status'] === 'error' ) :
echo $contact_form_response['values']['visitor_institution'];
endif;
?>
" required>
<label for="contact-institution">
<?php _e( 'Your institution (required)', 'pressbooks-aldine' ); ?>
</label>
</p>
<p class="form__row">
<textarea id="contact-message"
<?php
if ( isset( $contact_form_response['field'] ) && $contact_form_response['field'] === 'message' ) :
?>
class="error" <?php endif; ?>name="message" required>
<?php
if ( $contact_form_response['status'] === 'error' ) :
echo $contact_form_response['values']['message'];
endif;
?>

  1. Aldine Page Sections produce invalid markup, with some <p> elements opening and closing in unexpected places. This may be a WordPress autop problem? For example, the following input in the page editor:
[aldine_page_section title="Get Started" variant="bordered"]

Wondering how to get started with a publishing project? Pressbooks training webinars cover everything you need to know to create beautiful educational content, including creating your first book, importing content, uploading media, applying a theme, and producing export files.

[aldine_call_to_action text="Register for a Webinar" link="https://pressbooks.com/webinar/"]

[/aldine_page_section]

[aldine_page_section title="Find Open Textbooks" variant="bordered"]

Looking for open textbooks to adopt? Visit Pressbooks Directory and browse thousands of free resources. You can clone books found on the Directory directly to your Pressbooks network where they can be edited, adapted, and enhanced with interactive activities.

[aldine_call_to_action text="Visit Pressbooks Directory" link="https://pressbooks.directory"]

[/aldine_page_section]

[aldine_page_section title="Need Help?" variant="bordered"]

Need help with your Pressbooks project? Consult the Pressbooks User Guide, check out the short tutorial & training videos on the Pressbooks YouTube channel, or request direct assistance from your Network Manager.

[aldine_call_to_action text="View Support Resources" link="https://pressbooks.com/support/"]

[/aldine_page_section]

produces the following output (problems highlighted in bold):

<div class="entry-content">
		<div class="page-section page-section--bordered"><h2>Get Started</h2>
<p>Wondering how to get started with a publishing project? Pressbooks training webinars cover everything you need to know to create beautiful educational content, including creating your first book, importing content, uploading media, applying a theme, and producing export files.</p>
<p><a class="call-to-action" href="https://pressbooks.com/webinar/" title="Register for a Webinar">Register for a Webinar</a></p>
**<p>**</div>
<div class="page-section page-section--bordered"><h2>Find Open Textbooks</h2>**</p>**
<p>Looking for open textbooks to adopt? Visit Pressbooks Directory and browse thousands of free resources. You can <a href="https://guide.pressbooks.com/chapter/book-cloning/">clone books</a> found on the Directory directly to your Pressbooks network where they can be edited, adapted, and enhanced with interactive activities.</p>
<p><a class="call-to-action" href="https://pressbooks.directory" title="Visit Pressbooks Directory">Visit Pressbooks Directory</a></p>
**<p>**</div>
<div class="page-section page-section--bordered"><h2>Need Help?</h2>**</p>**
<p>Need help with your Pressbooks project? Consult the <a href="https://guide.pressbooks.com/">Pressbooks User Guide</a>, check out the short tutorial &#38; training videos on the <a href="https://www.youtube.com/c/Pressbooks/playlists">Pressbooks YouTube channel</a>, or <a href="#contact">request direct assistance</a> from your Network Manager.</p>
<p><a class="call-to-action" href="https://pressbooks.com/support/" title="View Support Resources">View Support Resources</a></p>
**<p>**</div>
**</p>**</div>
@SteelWagstaff SteelWagstaff added bug Something isn't working a11y This is an accessibility issue labels Nov 5, 2021
@SteelWagstaff SteelWagstaff changed the title Aldine Page Sections produce invalid markup Invalid markup in Aldine Nov 5, 2021
@SteelWagstaff
Copy link
Member Author

First issue might be simple fix. Try putting PHP on single line to see if it removes the line breaks in output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y This is an accessibility issue bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant