Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pagedjs
pagedjs
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 161
    • Issues 161
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 12
    • Merge Requests 12
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tools
  • pagedjspagedjs
  • Issues
  • #200

Closed
Open
Opened Apr 23, 2020 by Antonio Norman@antman3351
  • Report abuse
  • New issue
Report abuse New issue

Named page:first content:element ( ... ) is overwitten

Hello,

When using named pages I want to set the first page to a different header/footer than the following pages. Just the content:element(...) is getting over-written by the other pages (other styles like colour work).

#foobar {
    page:foobar;
}
#first_header {
    position:running(H_first_header);
}
#other_headers {
    position:running(H_other_headers);
}
@page foobar {
    @top-left {
        content: element(H_other_headers);
        background-color: red;
    }
}
@page foobar:first {
    @top-left {
        content: element(H_first_header);
        background-color: blue;
    }
}

I've managed to find a fix but have no idea if it's the right way to sort it. In modules/generated-content/running-headers.js line:149 I changed:

switch (parts.length) {
	case 4:
		if (parts[3] === "pagedjs_first_page" || parts[3].match(/pagedjs_[\w-]+_first_page/g) ) { // Added check for 1st named page
			weight = 7;
		} else if (parts[3] === "pagedjs_left_page" || parts[3] === "pagedjs_right_page") {
			weight = 6;
		}
	break;

P.S are there any docs for the code to better understand what parts do what?

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
1
Labels
Bug
Assign labels
  • View project labels
Reference: tools/pagedjs#200